Skip to content

Add migration SAS request and retry policies - #1447

Merged
sophiatev merged 4 commits into
mainfrom
stevosyan/storage-migration-request-policies
Dec 1, 2026
Merged

sophiatev merged 4 commits into
mainfrom
stevosyan/storage-migration-request-policies

Conversation

@sophiatev

Copy link
Copy Markdown
Contributor

A Storage request can reach the service after its migration SAS expires. Add request policies that refresh credentials and retry an AuthenticationFailed response 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 MigrationSasManagerTests and 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.

Copilot AI balanced review requested due to automatic review settings November 30, 2026 23:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 AuthenticationFailed response.
  • 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

Copilot AI balanced review requested due to automatic review settings November 30, 2026 23:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Copilot AI balanced review requested due to automatic review settings December 1, 2026 00:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues require further changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 1, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are identified that would block approval.

No open issues 🎉

Review effort: Balanced

@sophiatev
sophiatev merged commit 3b54e25 into main Dec 1, 2026
48 checks passed
@sophiatev
sophiatev deleted the stevosyan/storage-migration-request-policies branch December 1, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants