-
Notifications
You must be signed in to change notification settings - Fork 36
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
Question on Refresh behavior #1185
Comments
/сс @edwarnicke |
@sol-0 Delighted to talk you through it :) Let's start with the Client Chain. It includes a opts.refreshClient in the chain. By default, that opts.refreshClient is refresh.NewClient. However, if the user passes client.WithoutRefresh() then opts.refreshClient is set to null.NewClient which is a noop. This brings us around to the first central feature of refresh: It should only be performed by non-passthrough clients. The refresh chain element on Request computes the time after which it should send a refresh request which is roughly 1/3 the time remaining till expiration plus a little bit of noise. The refresh chain element creates a cancelCtx cancels any old cancelCtx from previous request and stores the new cancelCtx. From there a go routine is spawned to send the refresh at the computed time and, if it does not succeed, keep trying to send it. Note: if cancelCtx has been canceled (either by Close or a new Request) the go routine exits. The comment you so astutely noted is that we should probably clamp down the expireTime to the earliest time in the chain. |
I think we need to implement this. I see that it can be super useful for interdomain scenarios where two or more clusters can have a totally different spire setup. @edwarnicke Do you mind if we'll create an issue and describe a potential technical solution for this? |
@denis-tingaikin Please do |
@edwarnicke , @denis-tingaikin , |
Question
Hi @edwarnicke ,
I was checking how refresh mechanism works in NSM during issue #839 investigation, and I think refresh might be broken in the case when different mesh elements (nsmgr, forwarders, etc.) have different token expiry.
I checked your changes in this PR and saw that, e.g. in NSMgr server refresh was removed, so after that I also checked your discussion with Vladimir and found your response:
"...We could do as you suggested and compute that in refresh. I'm tempted though to do it in updatetoken by clamping down expiretime to the smallest in the path on the return direction of the path."
- could you please share whether anything was done here? As I couldn't find a place in the code where this case is handled.Also, if you don't mind, could you please describe how refresh mechanism is working currently?
The text was updated successfully, but these errors were encountered: