You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replication: MoveNextAsync throws NullReferenceException after the connection broke while a message was held #6700
If the connection breaks while the consumer is processing a message, e.g. because the feedback timer's status update failed on a dropped network, the timer only logs the failure (ReplicationConnection.cs:654-657), and breaking the connector disposes and clears its buffers (NpgsqlConnector.cs:2448-2453). The consumer's next MoveNextAsync then throws NullReferenceException, e.g. in NpgsqlConnector.ReadMessage, instead of an exception that says why the connection broke. A failed SendStatusUpdate has the same effect. On main with PostgreSQL 18.6, both a timer status update that failed after pg_terminate_backend and a failed SendStatusUpdate made the next MoveNextAsync throw that NullReferenceException in NpgsqlConnector.ReadMessage. A failed SendStatusUpdate did the same with 14.24, and in some runs gave an NpgsqlException over ObjectDisposedException instead. #6630 doesn't change this; it fixed the exceptions that SendStatusUpdate itself threw while the stream was being torn down.
The 8.0, 9.0 and 10.0 hotfix branches have the same code on this path, so they fail the same way (inferred).
Activity