postgresql/src/backend
Andres Freund 61ace8fe7f Prevent idle in transaction session timeout from sometimes being ignored.
The previous coding in ProcessInterrupts() could lead to
idle_in_transaction_session_timeout being ignored, when
statement_timeout occurred earlier.

The problem was that ProcessInterrupts() would return before
processing the transaction timeout if QueryCancelPending was set while
QueryCancelHoldoffCount != 0 - which is the case when reading new
commands from the client. Ergo when the idle transaction timeout would
hit.

Fix that by removing the early return. Alternatively the transaction
timeout code could have been moved up, but that early return seems
like an issue that could hit other cases too.

Author: Lukas Fittl
Bug: #14821
Discussion:
    https://www.postgresql.org/message-id/20170921010956.17345.61461%40wrigleys.postgresql.org
    https://www.postgresql.org/message-id/CAP53PkxQnv3OWJpyNPGJYT62uY=n1=2CF_Lpc6gVOFnc0-gazw@mail.gmail.com
Backpatch: 9.6-, where idle_in_transaction_session_timeout was introduced.
2017-10-11 14:02:41 -07:00
..
access Fix access-off-end-of-array in clog.c. 2017-10-06 12:20:13 -04:00
bootstrap Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
catalog Revert to 9.6 treatment of ALTER TYPE enumtype ADD VALUE. 2017-09-27 16:14:37 -04:00
commands Fix low-probability loss of NOTIFY messages due to XID wraparound. 2017-10-11 14:28:33 -04:00
executor Fix mistakes in comments. 2017-10-11 15:58:49 -04:00
foreign Abstract logic to allow for multiple kinds of child rels. 2017-04-03 22:41:31 -04:00
lib Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
libpq Fix saving and restoring umask 2017-09-23 10:03:05 -04:00
main Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
nodes Force rescanning of parallel-aware scan nodes below a Gather[Merge]. 2017-08-30 09:29:56 -04:00
optimizer Allow rel_is_distinct_for() to look through RelabelType below OpExpr. 2017-09-17 15:28:51 -04:00
parser After a MINVALUE/MAXVALUE bound, allow only more of the same. 2017-09-15 21:36:01 -04:00
po Translation updates 2017-10-02 12:03:01 -04:00
port Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
postmaster Simplify autovacuum work-item implementation 2017-08-15 18:14:07 -03:00
regex Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
replication Fix more user-visible elog() calls. 2017-10-05 08:00:12 -04:00
rewrite Message style fixes 2017-09-11 11:20:47 -04:00
snowball Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00
statistics Remove obsolete comments about functional dependencies 2017-07-26 11:40:39 -04:00
storage Increase distance between flush requests during bulk file copies. 2017-10-08 15:25:26 -04:00
tcop Prevent idle in transaction session timeout from sometimes being ignored. 2017-10-11 14:02:41 -07:00
tsearch Improve make_tsvector() to handle empty input, and simplify its callers. 2017-07-18 13:13:47 -04:00
utils Doc: fix missing explanation of default object privileges. 2017-10-11 16:57:15 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
Makefile Inject $(ICU_LIBS) regardless of platform. 2017-08-20 21:22:33 -07:00
nls.mk Translation updates 2017-09-11 12:49:35 -04:00