2
0

fix #65 : close cleanupDone channel on "FATAL" messages

This commit is contained in:
Georges Varouchas
2021-03-04 18:07:41 +01:00
committed by Jack Christensen
parent b9a1aad8d9
commit 36c8fb8257
+1
View File
@@ -487,6 +487,7 @@ func (pgConn *PgConn) receiveMessage() (pgproto3.BackendMessage, error) {
if msg.Severity == "FATAL" {
pgConn.status = connStatusClosed
pgConn.conn.Close() // Ignore error as the connection is already broken and there is already an error to return.
close(pgConn.cleanupDone)
return nil, ErrorResponseToPgError(msg)
}
case *pgproto3.NoticeResponse: