From 36c8fb8257391de896e4c934ace6e82ea5631f3a Mon Sep 17 00:00:00 2001 From: Georges Varouchas Date: Thu, 4 Mar 2021 18:07:41 +0100 Subject: [PATCH] fix #65 : close cleanupDone channel on "FATAL" messages --- pgconn.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pgconn.go b/pgconn.go index 53e32252..0c1717ff 100644 --- a/pgconn.go +++ b/pgconn.go @@ -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: