Repository navigation
fix(test): retry SQL Server deadlock victims - #10901
Merged
ReubenBond merged 1 commit intoAug 28, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Lite
Findings: None
What changed in this PR
This PR improves resilience of the SQL Server ADO.NET test database reset path in Orleans’ relational test utilities by treating SQL Server deadlock-victim failures as transient and retryable, reducing fixture initialization flakiness (per #10900).
Changes:
- Extend the bounded database reset retry logic to treat SQL Server error 1205 (deadlock victim) as retryable alongside 3702 (database in use).
- Add a focused unit test which validates the retryable/non-retryable classification for representative SQL error codes.
| File | Description |
|---|---|
| test/Extensions/Orleans.AdoNet.Tests/RelationalUtilities/SqlServerStorageForTesting.cs | Adds retryable error classification and uses it in DropDatabaseAsync retry filtering/logging. |
| test/Extensions/Orleans.AdoNet.Tests/RelationalUtilities/SqlServerStorageForTestingTests.cs | Adds a theory to validate which SQL Server error numbers are treated as retryable for database reset. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Aug 29, 2026
Merged
This was referenced Sep 7, 2026
This was referenced Sep 7, 2026
This was referenced Sep 9, 2026
Closed
Closed
This was referenced Sep 16, 2026
Open
Merged
Merged
This was referenced Sep 23, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
SQL Server can choose the test database reset command as a deadlock victim while stale test sessions are being rolled back. The existing bounded retry only handles error 3702, so transient error 1205 fails fixture initialization even though the next reset succeeds.
Solution
Classify SQL Server errors 1205 and 3702 as retryable database-reset failures. Each retry keeps the existing pool clearing behavior, while unrelated errors and the final failed attempt continue to surface.
Rationale
SQL Server explicitly guarantees that a deadlock victim's transaction is rolled back and can be rerun. Reusing the established three-attempt reset boundary handles that transient outcome without masking persistent setup failures.
Fixes #10900
Microsoft Reviewers: Open in CodeFlow