-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix concurrent token renewal issues #10794
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.
How does this work between multiple server
replicas? This promise cache is per-server - does that matter?
/hold
const aboutToExpireTime = new Date(); | ||
aboutToExpireTime.setTime(aboutToExpireTime.getTime() + 5 * 60 * 1000); | ||
if (token.expiryDate && token.expiryDate < aboutToExpireTime.toISOString()) { |
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.
Why was this renamed?
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.
Renaming was not necessary, but that reflect the purpose of this time, while refreshTime
does not.
Also note the change from 30 to 5 minutes before expiration.
@andrew-farries, that's a good question. The greatest problem to be solved with this PR actually occurs on a single server pod, which maintains a websocket, where a client is connected to. There are cases where a single user action (e.g. create workspace request) is triggering a bunch of API requests, which are made in parallel for a better performance, e.g. https://github.com/gitpod-io/gitpod/blob/main/components/server/src/gitlab/file-provider.ts#L19-L22. |
/hold cancel |
Description
Related Issue(s)
Fixes #10762
How to test
Release Notes
Documentation
Werft options: