-
Notifications
You must be signed in to change notification settings - Fork 933
Remove session finalizer #2811
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
Remove session finalizer #2811
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would either get rid of Dispose(bool isDisposing)
in this PR too, or only remove the using (BeginContext())
we have in Dispose(bool isDisposing)
, which is undue. (Dispose()
already handles it, and there is no reason to handle the context when finalizing, instead it must not be handled during finalization.)
With this current PR state, we end up with a partial dispose pattern implementation, which can be misleading for future changes. It looks like it handles finalization since it still has that disposing flag, but it does not.
I am for removing the finalizer and the isDisposing overload, at least for next minor. In this release branch, just removing the undue BeginContext will be enough, if not wiling to also remove the isDisposing overload.
This comment has been minimized.
This comment has been minimized.
I find confusing that this pattern is implemented but no unmanaged resources are handled by it. So I've added explicit comment about it. So IMHO no reasons to keep finalizers just to implement properly not needed pattern.
Yeah I didn't remove parameter to minimize changes as it's called from 2 places (from Dispose and CloseSessionFromSystemTransaction) and it's not straightforward change. Is it actually correct that CloseSessionFromSystemTransaction doesn't call full Dispose() method? It looks fishy to me...
Logger also can cause troubles - some loggers might be already disposed. Really I see zero reasons to keep finalizers. Let's drop them. |
|
This comment has been minimized.
This comment has been minimized.
Ok, forget it, I have re-read the thing, you are right. |
Turns out exception is possible from session Finalizer (regression made by #1984):
Suggested fix: Let's simply drop finalizers. They shouldn't be created in a first place - we have no unmanaged resources inside session. So we add additional pressure on finalizer thread for nothing