Repository navigation
fix(session): authenticate once before resolving feature flags - #423
Merged
Merged
Conversation
The feature-flag prefetch was the first caller of the auth provider and swallows its errors, so a failed token request was sent again by CreateSession with no backoff. Authenticate once right after the provider is attached; the prefetch and CreateSession reuse the cached token. Signed-off-by: Vu Anh Phung <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
vuanhphung
requested review from
aakash-saravanan-db,
cathleeny and
rahuls-db
November 3, 2026 22:08
cathleeny
approved these changes
Nov 3, 2026
This was referenced Nov 11, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a driver identity is set, the feature-flag prefetch in
Session::openis the first caller of the auth provider. If the token request fails there, the error is swallowed (flags fail open) and nothing is cached, so CreateSession immediately sends the token request again, with no backoff and ignoringRetry-After. Every failed open costs two token requests, exactly when the token endpoint is already overloaded. In the RE-17407 M2M benchmark (19,200 sessions opened in a burst), this added 9,968 token requests (+52%) while/oidc/v1/tokenwas returning 503s.Session::opennow authenticates once right after the auth provider is attached. The prefetch and CreateSession reuse the cached token, and a token failure fails the open with the original error. Successful opens are unchanged at one token request.New tests: a failed open against a 503 +
Retry-After: 60token endpoint sends one token request (two before this change), and a successful M2M open uses one token for both the flag fetch and CreateSession.This pull request and its description were written by Isaac.
This PR was created with GitHub MCP.