]> granicus.if.org Git - postgresql/commitdiff
Clear stmt_timeout_active if we disable_all_timeouts.
authorRobert Haas <rhaas@postgresql.org>
Fri, 9 Feb 2018 20:48:18 +0000 (15:48 -0500)
committerRobert Haas <rhaas@postgresql.org>
Fri, 9 Feb 2018 20:48:18 +0000 (15:48 -0500)
Otherwise, we can end up with the flag set when the timeout is
actually disabled, leading to misbehavior.  Commit
f8e5f156b30efee5d0038b03e38735773abcb7ed introduced this bug.

Reported by Peter Eisentraut.  Analysis and fix by Thomas Munro,
tweaked by me.

Discussion: http://postgr.es/m/6a909374-2602-7136-8c70-397330a418f3@2ndquadrant.com

src/backend/tcop/postgres.c

index ddc3ec860aed2870706d978d87c89b9d8d2f6641..6dc2095b9a765f4f682eb43652ff0c0ca2f0599e 100644 (file)
@@ -3912,6 +3912,7 @@ PostgresMain(int argc, char *argv[],
                 */
                disable_all_timeouts(false);
                QueryCancelPending = false; /* second to avoid race condition */
+               stmt_timeout_active = false;
 
                /* Not reading from the client anymore. */
                DoingCommandRead = false;