-
Notifications
You must be signed in to change notification settings - Fork 591
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
Closing an AutoRecoveringConnection does not stop it from continuing recovery forever #294
Comments
AutorecoveringConnection#BeginAutomaticRecovery does check |
Yes this sounds fair to me. |
Raised a PR for this. It does change the semantics of |
@kjnilsson we can throw unless there's recovery in progress. This behaviour ( @LoungeFlyZ @bording thoughts? |
It probably makes sense to move the |
@michaelklishin @kjnilsson I think most would expect Abort/Close to be idempotent also so i think that would be a good change. Right now in a few places when I Close/Abort I just try/catch around them but do nothing with the exceptions due to this. I'll take a look at the PR, but heading away on vacation for a few days, so replies might be slow. Thanks a lot for looking into this. I actually stumbled across this due to an odd situation where we lose our connection for a while and during that time the password is reset for the login, we negotiate with our API for the new credentials and tried to close/shutdown the old connection so that we can create a new one with the new creds. We noticed however that the reconnecting thread was still attempting to reconnect the old connection. I actually think this could lead to memory leaks as that old connection object sticks around and it has a reference to the connection factory also ... which i don't think will ever be let go due to this thread never ending. Our workaround for this currently, is to update the old connection factory user credentials and the old connection will then reconnect. But we would VERY much like to just close the old connection and spin up a new one ... much cleaner. |
@LoungeFlyZ we can make it idempotent for |
This does seem like a good change to make, and since you're already planning the If you are going to make Close no longer throw, that does bring into question, what is the point of keeping both Close and Abort around at that point since Abort is a non-throwing Close? |
@bording @LoungeFlyZ I can't promise when a |
@michaelklishin thanks. That would be great. Much appreciated. |
I think it is ok for Whilst we're at it: |
@kjnilsson sounds good. |
OK I've updated the PR not to throw exceptions in |
Once an AutoRecoveringConnection connection enters auto recovery and trying to recover the connection will continue to do try forever even if the connection is manually closed.
I am not super familiar with the code, but believe the issue lays in the RecoverConnectionDelegate method that enters a while loop and fails to check if the connection has been manually closed via the manuallyClosed variable.
The order for a repro is:
I would have expected that the connection would have given up trying to reconnect after it was closed, but i might be missing some subtle issue here that i am not aware of.
The text was updated successfully, but these errors were encountered: