You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, we're fetching the Zoom access token on every request. We used to request a new token if the current token was expired, but since Zoom only allows one valid access token at a time, we ran into a race condition when another Function instance would request a new token.
Ex:
Instance A spins up and requests a token.
Soon after, instance B spins up and requests a new token, invalidating instance A's token
Then if A served another request, it would attempt to use the invalid previous token, since it has not yet expired.
Describe the solution you'd like
We could share one token using Datastore.
Pseudocode
Function
get token from Datastore
if token expired?
request new token
store token and expiresIn values in Datastore
return token
return valid token
Describe alternatives you've considered
Requesting a new token every invocation seems to work well enough now, but I think will fail with concurrent spikes of requests.
This
https://cloud.google.com/appengine/docs/legacy/standard/go111/datastore/api-overview
Is your feature request related to a problem? Please describe.
Currently, we're fetching the Zoom access token on every request. We used to request a new token if the current token was expired, but since Zoom only allows one valid access token at a time, we ran into a race condition when another Function instance would request a new token.
Ex:
Instance
A
spins up and requests a token.Soon after, instance
B
spins up and requests a new token, invalidating instanceA
's tokenThen if
A
served another request, it would attempt to use the invalid previous token, since it has not yet expired.Describe the solution you'd like
We could share one token using Datastore.
Pseudocode
Describe alternatives you've considered
Requesting a new token every invocation seems to work well enough now, but I think will fail with concurrent spikes of requests.
Additional context
service-signups/zoom.go
Lines 86 to 90 in f081812
The text was updated successfully, but these errors were encountered: