Repository navigation
Add migration SAS request and retry policies - #1447
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The synchronous SAS refresh can deadlock after an authentication failure on UI or classic ASP.NET threads because it blocks on asynchronous work that captures the calling synchronization context.
1 open issue
What changed in this PR
Adds request policies for migration SAS handling in the Azure Storage provider. Runtime client wiring is deferred, so existing clients are unaffected.
Changes:
- Refresh credentials and retry once after an
AuthenticationFailedresponse. - Check migration access before each send, enforce one 30-second timeout, and set the delegation-compatible version for Queue and Table requests.
- Add SDK-pipeline tests for refreshed signatures, body preservation, retry limits, drain, cancellation, and error filtering.
| File | Description |
|---|---|
test/DurableTask.AzureStorage.Tests/MigrationSasManagerTests.cs |
Adds simulated Queue, Table, and Blob pipeline tests for the policies. |
src/DurableTask.AzureStorage/Http/MigrationSasRetryPolicy.cs |
Implements synchronous and asynchronous authentication refresh and retry. |
src/DurableTask.AzureStorage/Http/MigrationRequestPolicy.cs |
Enforces migration access, request timeout, and service-version settings. |
Review effort: Balanced
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The synchronous retry can deadlock on UI or classic ASP.NET synchronization contexts because refresh continuations capture the thread blocked by GetResult(), requiring a context-independent refresh path and a regression test.
1 open issue
1 resolved since last review
Review effort: Balanced
halspang
reviewed
Dec 1, 2026
halspang
approved these changes
Dec 1, 2026
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.


A Storage request can reach the service after its migration SAS expires. Add request policies that refresh credentials and retry an
AuthenticationFailedresponse once, while blocking further sends once migration is ending. Each SDK retry keeps one 30-second server timeout; Queue and Table requests use the delegation-compatible service version.The policies are extracted from
stevosyan/storage-migration. Runtime client wiring follows in a later PR, so this change does not activate migration behavior for existing clients. No experimental performance telemetry is included.Tests extend
MigrationSasManagerTestsand use real Queue, Table, and Blob SDK pipelines with local simulated responses. They cover synchronous and asynchronous retries with fresh signatures and unchanged bodies, the one-retry limit, drain, cancellation, error filtering, and timeout replacement during SDK retries.Validation: 82 tests passed on .NET 8 and 82 on .NET Framework 4.8 (164 total), including 19 new policy cases. No Azure account or emulator is needed.