Skip to content

Commit 6ad86fe

Browse files
committed
Add CHECK_FOR_INTERRUPTS in ExecInsert's speculative insertion loop.
Ordinarily the functions called in this loop ought to have plenty of CFIs themselves; but we've now seen a case where no such CFI is reached, making the loop uninterruptible. Even though that's from a recently-introduced bug, it seems prudent to install a CFI at the loop level in all branches. Per discussion of bug #17558 from Andrew Kesper (an actual fix for that bug will follow). Discussion: https://postgr.es/m/17558-3f6599ffcf52fd4a@postgresql.org
1 parent cc11647 commit 6ad86fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/executor/nodeModifyTable.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,9 +956,11 @@ ExecInsert(ModifyTableContext *context,
956956
*
957957
* We loop back here if we find a conflict below, either during
958958
* the pre-check, or when we re-check after inserting the tuple
959-
* speculatively.
959+
* speculatively. Better allow interrupts in case some bug makes
960+
* this an infinite loop.
960961
*/
961962
vlock:
963+
CHECK_FOR_INTERRUPTS();
962964
specConflict = false;
963965
if (!ExecCheckIndexConstraints(resultRelInfo, slot, estate,
964966
&conflictTid, arbiterIndexes))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy