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
pgconn: guard receiveMessage against closed connection
Add a status check at the top of PgConn.receiveMessage() to return an
error immediately when the connection is already closed. This prevents
pipeline mode from calling receiveMessage() on a dead connection when
multiple FATAL errors are buffered together.
Previously, the fix guarded close(cleanupDone) in the ErrorResponse
handler to prevent double-close. This approach is more fundamental: it
stops the second FATAL from even being processed by receiveMessage(),
which is consistent with how lock() already rejects calls on closed
connections.
The nil-results check in Pipeline.Close() remains as a safety net for
the case where FATAL errors exhaust the request queue without the server
ever sending ReadyForQuery.
0 commit comments