aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/tcop/postgres.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index b8d860ebdbf..63a1994e61e 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -2914,26 +2914,24 @@ ProcessInterrupts(void)
" database and repeat your command.")));
}
- if (QueryCancelPending)
+ /*
+ * Don't allow query cancel interrupts while reading input from the
+ * client, because we might lose sync in the FE/BE protocol. (Die
+ * interrupts are OK, because we won't read any further messages from
+ * the client in that case.)
+ */
+ if (QueryCancelPending && QueryCancelHoldoffCount != 0)
{
- bool lock_timeout_occurred;
- bool stmt_timeout_occurred;
-
/*
- * Don't allow query cancel interrupts while reading input from the
- * client, because we might lose sync in the FE/BE protocol. (Die
- * interrupts are OK, because we won't read any further messages from
- * the client in that case.)
+ * Re-arm InterruptPending so that we process the cancel request
+ * as soon as we're done reading the message.
*/
- if (QueryCancelHoldoffCount != 0)
- {
- /*
- * Re-arm InterruptPending so that we process the cancel request
- * as soon as we're done reading the message.
- */
- InterruptPending = true;
- return;
- }
+ InterruptPending = true;
+ }
+ else if (QueryCancelPending)
+ {
+ bool lock_timeout_occurred;
+ bool stmt_timeout_occurred;
QueryCancelPending = false;