Keep transaction cleanup independent of request cancellation#5574
Open
mikaelweave wants to merge 6 commits into
Open
Keep transaction cleanup independent of request cancellation#5574mikaelweave wants to merge 6 commits into
mikaelweave wants to merge 6 commits into
Conversation
Move the SqlServerFhirDataStore failed-transaction cleanup token change out of PR #5553 so it can be reviewed independently from the BundleHandler cancellation response mapping. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5574 +/- ##
==========================================
- Coverage 77.37% 77.31% -0.06%
==========================================
Files 993 996 +3
Lines 36418 36539 +121
Branches 5518 5539 +21
==========================================
+ Hits 28177 28251 +74
- Misses 6880 6918 +38
- Partials 1361 1370 +9 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove test changes not required for the cancelled-retry-delay cleanup regression: revert ResourceWrapper search/compartment/claims to null, drop the expanded mock provider compartment setup, and remove a redundant Assert.NotNull already covered by Assert.IsAssignableFrom. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When the client cancels during the retriable merge-failure retry delay, let the OperationCanceledException propagate without running MergeResourcesCommitTransactionAsync. The TransactionWatchdog rolls abandoned transactions forward/back, so inline cleanup is redundant here. This removes the ExceptionDispatchInfo capture/rethrow dance. Simplify the cancellation test to use an NSubstitute mock instead of a hand-written ISqlRetryService fake, restore the shared ModelInfoProvider compartment setup needed by sibling tests, and add a focused regression test asserting non-cancellation cleanup still runs with CancellationToken.None. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…led requests during retries
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.
Summary
Changes
SqlServerFhirDataStore.cs: passCancellationToken.NonetoMergeResourcesCommitTransactionAsyncin theMergeInternalAsyncsingle-transaction catch block.AB#188321
Testing
dotnet test src\Microsoft.Health.Fhir.SqlServer.UnitTests\Microsoft.Health.Fhir.SqlServer.UnitTests.csproj --no-restore --verbosity minimaldotnet build src\Microsoft.Health.Fhir.SqlServer\Microsoft.Health.Fhir.SqlServer.csproj --no-restore --nologo --verbosity quietgit diff --check