From 95aa87f2e8c75abf4931bc73d0302b86d53f68ba Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Mon, 10 Jul 2023 20:29:41 -0500 Subject: [PATCH] exitPotentialWriteReadDeadlock stops bgReader It's not enough to stop the slowWriteTimer, because the bgReader may have been started. --- pgconn/pgconn.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pgconn/pgconn.go b/pgconn/pgconn.go index 95a8a143..12357751 100644 --- a/pgconn/pgconn.go +++ b/pgconn/pgconn.go @@ -1732,6 +1732,7 @@ func (pgConn *PgConn) exitPotentialWriteReadDeadlock() { // The state of the timer is not relevant upon exiting the potential slow write. It may both // fire (due to a slow write), or not fire (due to a fast write). _ = pgConn.slowWriteTimer.Stop() + pgConn.bgReader.Stop() } func (pgConn *PgConn) flushWithPotentialWriteReadDeadlock() error {