Further second thoughts about idle_session_timeout patch.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: a112efa6a015cc3e0e752e36ece4ed10ede1d714
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2021-01-07T16:45:09Z
Releases: 11.11
Further second thoughts about idle_session_timeout patch.

On reflection, the order of operations in PostgresMain() is wrong.
These timeouts ought to be shut down before, not after, we do the
post-command-read CHECK_FOR_INTERRUPTS, to guarantee that any
timeout error will be detected there rather than at some ill-defined
later point (possibly after having wasted a lot of work).

This is really an error in the original idle_in_transaction_timeout
patch, so back-patch to 9.6 where that was introduced.

Files

PathChange+/−
src/backend/tcop/postgres.c modified +12 −10