Synchronize SAVEPOINT replay cancellation before mock RPC release - #975
Merged
Merged
Conversation
Keep the reconstruction SQL barrier closed after cancel() so prepareSQL can only leave via ctx.Done(). Closing releaseSQL immediately raced with cancellation and let reconstruction succeed. Cleanup still unblocks the mock on test failure. Fixes #973 Co-authored-by: apstndb <apstndb@users.noreply.github.com>
…el-test-sync-973-a066 Co-authored-by: apstndb <apstndb@users.noreply.github.com>
Code Metrics Report📊 View detailed coverage report (available for 7 days)
Details | | main (ec4e0be) | #975 (8ef92e4) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 86.7% | 86.7% | +0.0% |
| Files | 112 | 112 | 0 |
| Lines | 10405 | 10428 | +23 |
+ | Covered | 9029 | 9051 | +22 |
+ | Code to Test Ratio | 1:2.2 | 1:2.2 | +0.0 |
| Code | 23263 | 23309 | +46 |
+ | Test | 52022 | 52940 | +918 |
- | Test Execution Time | 1m51s | 1m54s | +3s |Code coverage of files in pull request scope (88.7% → 88.8%)
Reported by octocov |
apstndb
marked this pull request as ready for review
September 14, 2026 12:36
Owner
Author
|
Independent review of HEAD Independently validated this exact HEAD: the cancellation test passed 50 repetitions, the race-enabled test passed 10 repetitions, and |
cursor Bot
pushed a commit
that referenced
this pull request
Sep 14, 2026
…-36c5 Co-authored-by: apstndb <apstndb@users.noreply.github.com>
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.
Fixes #973.
TestSavepointReplayCancellationCleansUpWithoutCommitcancelled the command and immediately closedreleaseSQL. That opened the mock's successful-response path before the cancelled context necessarily reachedprepareSQL, so reconstruction could finish witherr == nil(reconstruction error = <nil>on0f7522b).The heartbeat RPC harness already selects on
ctx.Done()while the candidate SQL is blocked. This change keeps that barrier closed aftercancel()so the in-flight RPC can only leave via cancellation.t.Cleanupstill closesreleaseSQLif the test fails or times out.Assertions are unchanged: assigned candidate identity, cancelled cause, ended logical owner, cleared recovery, candidate rollback, and no Commit. No production code change, no sleeps or assertion retries, and draft #947 is untouched.
Based on origin/main
f10a4daafter an additive merge of #972.