FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix teardown NRE/ODE in ReplicationConnection's SendStatusUpdate by Hawxy · Pull Request #6630 · npgsql/npgsql · GitHub

/ npgsql Public

Fix teardown NRE/ODE in ReplicationConnection's SendStatusUpdate - #6630

Open
Hawxy wants to merge 1 commit into
npgsql:mainfrom
Hawxy:fix-replication-feedback-teardown-race
Open

Fix teardown NRE/ODE in ReplicationConnection's SendStatusUpdate#6630
Hawxy wants to merge 1 commit into
npgsql:mainfrom
Hawxy:fix-replication-feedback-teardown-race

Conversation

Hawxy commented Aug 11, 2026

Copy link
Copy Markdown

If the replication connection gets torn down whilst SendStatusUpdate is in-flight, you get to spin the wheel on getting an NRE or ODE which isn't ideal:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Npgsql.Replication.ReplicationConnection.SendFeedback(Boolean waitOnSemaphore, Boolean requestReply, CancellationToken cancellationToken)
   at Npgsql.Replication.ReplicationConnection.SendStatusUpdate(CancellationToken cancellationToken)

This fixes it so OperationCanceledException and InvalidOperationException are the only exceptions that show up and should match developer expectations a bit better.

Hawxy requested review from Brar, roji and vonzshik as code owners August 11, 2026 15:45
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL