Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 23edf0e

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 8d38cca commit 23edf0e

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
@@ -541,9 +541,11 @@ ExecInsert(ModifyTableState *mtstate,
541541
*
542542
* We loop back here if we find a conflict below, either during
543543
* the pre-check, or when we re-check after inserting the tuple
544-
* speculatively.
544+
* speculatively. Better allow interrupts in case some bug makes
545+
* this an infinite loop.
545546
*/
546547
vlock:
548+
CHECK_FOR_INTERRUPTS();
547549
specConflict = false;
548550
if (!ExecCheckIndexConstraints(slot, estate, &conflictTid,
549551
arbiterIndexes))

0 commit comments

Comments
 (0)