Skip to content

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

Merged
merged 4 commits into from
Nov 29, 2017
Merged

Merge 5.0.2 #1459

merged 4 commits into from
Nov 29, 2017

Conversation

fredericDelaporte
Copy link
Member

No description provided.

hazzik and others added 4 commits November 27, 2017 11:04
…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.
* Release 5.0.2
* Add a missing breaking change (reported with #1438).
@fredericDelaporte fredericDelaporte added this to the 5.0.2 milestone Nov 29, 2017
@hazzik
Copy link
Member

hazzik commented Nov 29, 2017

Ooops.

@fredericDelaporte
Copy link
Member Author

Ok, does not look as what it should be. Going to restore the branch.

@fredericDelaporte
Copy link
Member Author

fredericDelaporte commented Nov 29, 2017

You done it before me? I got an "Everything up-to-date" at time of doing it.

@hazzik
Copy link
Member

hazzik commented Nov 29, 2017

Yes, sorry

@fredericDelaporte
Copy link
Member Author

fredericDelaporte commented Nov 29, 2017

Not a trouble, so closing this PR, going to do another one from a branch on my repo.

@hazzik
Copy link
Member

hazzik commented Nov 29, 2017

Just wonder what shall the constructor of SessionIdLoggingContext look like? I got this:

public SessionIdLoggingContext(Guid id)
{
	if (id == Guid.Empty) return;
	_oldSessonId = SessionId;
	if (id == _oldSessonId) return;
	_hasChanged = true;
	SessionId = id;
}

@hazzik hazzik reopened this Nov 29, 2017
@hazzik
Copy link
Member

hazzik commented Nov 29, 2017

@fredericDelaporte don't worry, I'll merge manually.

@fredericDelaporte
Copy link
Member Author

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.

@fredericDelaporte
Copy link
Member Author

fredericDelaporte commented Nov 29, 2017

@fredericDelaporte don't worry, I'll merge manually.

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.

@hazzik
Copy link
Member

hazzik commented Nov 29, 2017

Your version of the constructor does read the session from the context when tracking is disabled.

@fredericDelaporte
Copy link
Member Author

fredericDelaporte commented Nov 29, 2017

It just reads whether the lazy is initialized when no sessions are tracking.
If one is tracking, anyway all sessions logging will start to read the context since they directly call the context property, which will find the lazy initialized.

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.

@hazzik
Copy link
Member

hazzik commented Nov 29, 2017

But lazy isn't used in Full .NET Fx

@fredericDelaporte
Copy link
Member Author

You are right. But the reasoning still holds true: CallContext is anyway read at each logs done by any session, be it tracking or not. Sparring a read when the session sets its context is unlikely to be significant. And sparring it creates a bug (non-tracking session may log session id of tracking one).

For checking all that I then need to do a merged branch and run the bench on it.

@hazzik hazzik merged commit 4e7fbc7 into master Nov 29, 2017
@hazzik
Copy link
Member

hazzik commented Nov 29, 2017

CallContext is anyway read at each logs done by any session, be it tracking or not.

As I understand this happens only if you run NHProf, which messes with the SessionIdLoggingContext.SessionId. Otherwise, no one reads it. I don't really worry about that case.

And sparring it creates a bug (non-tracking session may log session id of tracking one).

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.

@fredericDelaporte
Copy link
Member Author

fredericDelaporte commented Nov 29, 2017

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.)

@fredericDelaporte
Copy link
Member Author

fredericDelaporte commented Nov 29, 2017

@hazzik I fear staging the fix to default invalid merge has been missed, master is broken. I am going to commit the fix. (Done: ef86fdf)

fredericDelaporte added a commit that referenced this pull request Nov 29, 2017
@hazzik
Copy link
Member

hazzik commented Nov 29, 2017

Thanks @fredericDelaporte

@hazzik
Copy link
Member

hazzik commented Nov 29, 2017

I’ve protected the 5.0.x branch, so, no more delete button.

@hazzik
Copy link
Member

hazzik commented Nov 29, 2017

@fredericDelaporte the tests are still failing. Strangely enough, they don't fail when they run in isolation.

@hazzik
Copy link
Member

hazzik commented Nov 30, 2017

@fredericDelaporte ProcessHelper is broken. The test interfering with #1391 is ReconnectAfterClose. This test is trying to start a process on an already disposed session which obviously fails. But before it fails it is able to create a new SessionIdLoggingContext. Which later will not be disposed.

Addressed with 63dee05.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants