Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5db4fdc

Browse files
committed
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 thepost-command-read CHECK_FOR_INTERRUPTS, to guarantee that anytimeout error will be detected there rather than at some ill-definedlater point (possibly after having wasted a lot of work).This is really an error in the original idle_in_transaction_timeoutpatch, so back-patch to 9.6 where that was introduced.
1 parent0f8977b commit5db4fdc

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4269,7 +4269,18 @@ PostgresMain(int argc, char *argv[],
42694269
firstchar=ReadCommand(&input_message);
42704270

42714271
/*
4272-
* (4) disable async signal conditions again.
4272+
* (4) turn off the idle-in-transaction timeout, if active. We do
4273+
* this before step (5) so that any last-moment timeout is certain to
4274+
* be detected in step (5).
4275+
*/
4276+
if (disable_idle_in_transaction_timeout)
4277+
{
4278+
disable_timeout(IDLE_IN_TRANSACTION_SESSION_TIMEOUT, false);
4279+
disable_idle_in_transaction_timeout= false;
4280+
}
4281+
4282+
/*
4283+
* (5) disable async signal conditions again.
42734284
*
42744285
* Query cancel is supposed to be a no-op when there is no query in
42754286
* progress, so if a query cancel arrived while we were idle, just
@@ -4280,15 +4291,6 @@ PostgresMain(int argc, char *argv[],
42804291
CHECK_FOR_INTERRUPTS();
42814292
DoingCommandRead= false;
42824293

4283-
/*
4284-
* (5) turn off the idle-in-transaction timeout
4285-
*/
4286-
if (disable_idle_in_transaction_timeout)
4287-
{
4288-
disable_timeout(IDLE_IN_TRANSACTION_SESSION_TIMEOUT, false);
4289-
disable_idle_in_transaction_timeout= false;
4290-
}
4291-
42924294
/*
42934295
* (6) check for any other interesting events that happened while we
42944296
* slept.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp