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
{{ message }}
Repository navigation
Commit 9d12974
Browse filesBrowse the repository at this point in the historyBrowse files
[Core] Don't leave callers waiting forever when a token refresh is cancelled (#50856)
* Don't leave callers waiting forever when a token refresh is cancelled
AccessTokenCache and SimpleTokenCache let one caller refresh the token
while concurrent callers wait on a Sinks.One. When the refreshing caller
was cancelled, the Mono.using cleanup only reset wip and never completed
the sink, so every waiting caller stayed pending indefinitely.
The cleanup now also completes the sink empty, a no-op when the refresh
already completed it. Released callers use the current cached token if
it is still valid and otherwise acquire a new one. The branch for an
already finished refresh uses the same fallback instead of returning a
captured token that could be null or expired.
Fixes#50855
* Release waiting token callers only after clearing the in-progress refresh
When the token request completed empty, the NO REFRESH branch released
waiting callers while wip still held the finished refresh. In
SimpleTokenCache a released waiter then re-entered the acquisition, found
the same completed sink, and recursed until StackOverflowError.
Waiting callers are now released only by the Mono.using cleanup, after
wip has been cleared, so a retrying waiter always starts a new
acquisition. SimpleTokenCache retries through a private acquireToken()
instead of the overridable getToken().
0 commit comments