Repository navigation
Fix teardown NRE/ODE in ReplicationConnection's SendStatusUpdate - #6630
Merged
Merged
Conversation
Brar
added a commit
to Brar/npgsql
that referenced
this pull request
Oct 25, 2026
SendStatusUpdate_racing_replication_teardown_throws_InvalidOperationException, which npgsql#6630 added, cancels a replication stream and starts the next one on the same connection, ten times. Servers before PostgreSQL 10 ignore cancellation requests on replication connections, so there Npgsql can only cancel the stream by breaking the connection, and the test failed with "Connection is not open" when it started the second stream. It now requires PostgreSQL 10. This is a test-only gate for npgsql#6630's test, so npgsql#6630 itself stays unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
If the replication connection gets torn down whilst
SendStatusUpdateis in-flight, you get to spin the wheel on getting an NRE or ODE which isn't ideal:This fixes it so
OperationCanceledExceptionandInvalidOperationExceptionare the only exceptions that show up and should match developer expectations a bit better.