-
Notifications
You must be signed in to change notification settings - Fork 27
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: Why is default value of token refresh 30 seconds? #328
Comments
That's configurable in the More importantly, that's not a token refresh period. IF a token expires within the next "renew grace period" then the token will be refreshed. So if your token TTL is 5 minutes, and you have the default of 30 seconds grace period, your token will be updated after 4 minutes and 30 seconds. It's not a configuration you should ever really need, unless your Vault instance is under such load that it takes 20+ seconds to respond to token renewals. |
Hmm, that is not how I experience it. I tried it with following config (as test):
As you can see in the log the token only gets refresh around 30s or closer to expiry date. It looks like the database lease gets refreshed within grace period when the max-lifetime is over. As you can see in the latest example I triggered a database call around 00:33:03. Around this the the max-lifetime was over but the token wasn't being refreshed because it was not within the 30 seconds. The next refresh is 45 seconds later because thats when the max-lifetime is over. Only when I make a call before the token is expired I get an error because it has not been extended within the 30 window. So the db-lease isn't valid anymore. Can you spot the error I have? |
@kdubb Is this something you recognize? Because I having trouble with longer running jobs. The database leases are getting extendend every 30 minutes (max lifetime 30m and grace period 35 min) but the token itself is not. Because my token is valid for 1H the job throws error after one hour: I have worked around this problem by making the token valid for longer. But I do not think that should be the fix. |
@kdubb Sorry to bother you again. But I am still experience this problem. Can you see what is going wrong is logs above?
Why is is using a cached token when grace-period is 1m? |
Question: Why is default value of token refresh 30 seconds?
Is there a way to override this (I cannot find it) ? In practice always a new token will be created (unless there is a call triggered within the 30 seconds of the expiry time.
The text was updated successfully, but these errors were encountered: