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
Improves error handling for AAD token acquisition through Managed Identity and DefaultAzureCredential.
Token acquisition previously surfaced timeout and interruption failures as generic Managed Identity token acquisition errors. This change introduces explicit handling for these cases while preserving the underlying exception cause for diagnostics.
❌ Patch coverage is 86.53846% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.68%. Comparing base (644188c) to head (5908a5b). ⚠️ Report is 9 commits behind head on main.
Only restore the interrupt flag when the current login thread was interrupted. This scans an arbitrary asynchronous credential failure and always interrupts the caller, so an InterruptedException raised by an Azure Identity/Reactor worker will spuriously leave the unrelated login thread interrupted. The MSAL mapper in this PR already avoids this for ExecutionException-wrapped worker interruptions; this path needs the same distinction (for example, identify Reactor's blockOptional interruption wrapper/marker rather than treating every nested interruption as caller interruption).
This unconditionally interrupts the login thread whenever any nested cause is an InterruptedException. Unlike the direct Future.get path below, this reactive chain may also deliver an interruption raised on an Azure/Reactor worker; in that case the caller was never interrupted, but it is returned to the pool with its interrupt flag set. The MSAL mapper explicitly distinguishes direct caller interruption from an ExecutionException carrying worker interruption (and tests that distinction). Please likewise distinguish an interruption produced by this thread's blockOptional() wait from one propagated by the credential pipeline before restoring the caller flag.
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
EnhancementAn enhancement to the driver. Lower priority than bugs.
2 participants
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.
Description
Improves error handling for AAD token acquisition through Managed Identity and
DefaultAzureCredential.Token acquisition previously surfaced timeout and interruption failures as generic Managed Identity token acquisition errors. This change introduces explicit handling for these cases while preserving the underlying exception cause for diagnostics.
Related to #3038
Changes
ManagedIdentityCredentialDefaultAzureCredentialSQLServerExceptioncause.Testing