-
Notifications
You must be signed in to change notification settings - Fork 251
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
Terminate client renewal goroutine if creating new session #132
Comments
Thanks for raising this issue. I'll take a look into it. |
Looks like the way wait time is computed is also a problem. |
I think I understand the reason for *5/6, it is for automatically retry if renewTGT fails. However, this causes problem if updateSession runs ASExchange(). In my case, RenewTill is zero, so it always creates new session. Why RenewTill is zero remains puzzle to me, because in command line, klist gives me a valid RenewTill time. |
Branch "issue-132" has some updates that I think should resolve this. Are you able to try it and check if it resolves the issue for you? Thanks. |
I think it solves the problem. Will this be merged to master soon? |
Yes, I'll be looking to merge today and create a new release. |
I was looking into merging this and realised the fix I had would not cover the case of code calling Login multiple times themselves so I have updated to give the auto renew goroutine a cancellation channel. Any time AddSession() is called any pre-exiting sessions have the cancellation signal sent so auto renew goroutines should exit. Can you take another look and see if this fixes things for you. If so, I will get it merged to master. It would be useful if you could share some details about how you tested and discovered this as I've been thinking about how to automate some tests around it and I'm not sure of the best way to do so. Any information you have may be useful to me. Thanks! |
I left a review comment. |
Just doing some integration tests and then I'll merge. I have docker images for KDCs to test against. |
The change looks good to me. Thank you! |
In Client's updateSession funciton, if renew time passes, we will call ASExchange and it will create a new session. However, the goroutine ran by enableAutoSessionRenewal is still running, when we create a new session we will start another goroutine to call updateSession. Hence, two goroutines will call updateSession. UpdateSession will create more sessions by calling ASExchange, which create new goroutines again. The renewal goroutine grows exponentially, which can cause serious problem. If we call ASExchange to add a new session, the previous goroutine should be terminated.
The text was updated successfully, but these errors were encountered: