-
Notifications
You must be signed in to change notification settings - Fork 933
Merge 5.0.2 #1459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge 5.0.2 #1459
Conversation
…ed (#1453) - Use CallContext.LogicalGetData/LogicalSetData instead of AsyncLocal<T> on Full .NET Fx
- NH-4052 (#663) has introduced a new exception class but has forgotten to provide its serializable implementation.
* Reduces object allocations.
* Release 5.0.2 * Add a missing breaking change (reported with #1438).
Ooops. |
Ok, does not look as what it should be. Going to restore the branch. |
You done it before me? I got an "Everything up-to-date" at time of doing it. |
Yes, sorry |
Not a trouble, so closing this PR, going to do another one from a branch on my repo. |
Just wonder what shall the constructor of public SessionIdLoggingContext(Guid id)
{
if (id == Guid.Empty) return;
_oldSessonId = SessionId;
if (id == _oldSessonId) return;
_hasChanged = true;
SessionId = id;
} |
@fredericDelaporte don't worry, I'll merge manually. |
Yes, my bad commit would have shown you how I have fixed it, but now it is no more! It was: public SessionIdLoggingContext(Guid id)
{
var trackedId = id == Guid.Empty ? default(Guid?) : id;
_oldSessonId = SessionId;
if (trackedId == _oldSessonId) return;
_hasChanged = true;
SessionId = trackedId;
} It handles "mixed case", where some session would have tracking enabled while other would not. |
As you want. As the TC release build was ended I have switched to finishing the publishing (done now), and I was about to do the merge. |
Your version of the constructor does read the session from the context when tracking is disabled. |
It just reads whether the lazy is initialized when no sessions are tracking. So reading it on "context set" is then just a very small overhead compared to all the reads that will anyway occurs on each log call. And it avoids having non tracking session logging the session id of a tracking one. |
But lazy isn't used in Full .NET Fx |
You are right. But the reasoning still holds true: For checking all that I then need to do a merged branch and run the bench on it. |
As I understand this happens only if you run NHProf, which messes with the
As I understand this could happen only if 2 sessions from different session factories run alongside in the same thread. (Or someone messes with the options before creating the session). UPD: The "untracking session" should start running while the "tracking session" is running an operation in the same thread. I don't think that this is possible at all. |
No, just use two session factories on the same thread, one tracking, the other one not tracking. Open a session from the first with an interceptor using a session from the second. (Quite like the "interlaced" test I have added in #1455.) Yeah that is quite contrived, that is why your merge choice is ok for me anyway. (Upd: too used of clicking that "delete" button below, I fear I will end-up clicking it if I keep going on that PR.) |
Thanks @fredericDelaporte |
I’ve protected the 5.0.x branch, so, no more delete button. |
@fredericDelaporte the tests are still failing. Strangely enough, they don't fail when they run in isolation. |
@fredericDelaporte ProcessHelper is broken. The test interfering with #1391 is Addressed with 63dee05. |
No description provided.