Clear stmt_timeout_active if we disable_all_timeouts.

Otherwise, we can end up with the flag set when the timeout is
actually disabled, leading to misbehavior.  Commit
f8e5f156b3 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
This commit is contained in:
Robert Haas 2018-02-09 15:48:18 -05:00
parent 958e20e42d
commit be42015fcc
1 changed files with 1 additions and 0 deletions

View 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;