Repository navigation
Concurrent calls to GetSession wait instead of falling back to bearer authentication - #7528
wonwuakpa-msft wants to merge 3 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
The blobs test target cannot compile because of a duplicate test definition and an invalid SessionProvider constructor call, and four new concurrency tests leave sessions disabled in Auto mode.
3 open issues
What changed in this PR
This PR addresses concurrent Blob session requests falling back to bearer authentication while another caller is creating a session.
Changes:
- Adds per-container locking to serialize session creation and refresh.
- Uses bounded waits with cancellation checks and cached-session rechecks.
- Adds concurrency regression tests and makes the test credential counter atomic.
| File | Description |
|---|---|
sdk/storage/azure-storage-blobs/test/ut/session_authentication_test.cpp |
Adds tests for concurrent creation, container independence, cancellation, and failure handling. |
sdk/storage/azure-storage-blobs/src/private/token_credential_session_provider.hpp |
Adds a timed session-creation mutex to each container cache entry. |
sdk/storage/azure-storage-blobs/src/private/token_credential_session_provider.cpp |
Coordinates concurrent session creation with cancellable waits and cache rechecks. |
Review effort: Balanced
|
The production code change looks reasonable to me. However, the added tests are failing CI. Could we remove the test-code changes from this PR? The recently added session-feature tests already provide some indirect regression coverage for the updated code. Please also update the |


Pull Request Checklist
Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly:
See the detailed list in the contributing guide.