diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 89d2d4a7b8..9abc11bea5 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -2806,6 +2806,16 @@ RecoveryConflictInterrupt(ProcSignalReason reason) } } + /* + * Set the process latch. This function essentially emulates signal + * handlers like die() and StatementCancelHandler() and it seems prudent + * to behave similarly as they do. Alternatively all plain backend code + * waiting on that latch, expecting to get interrupted by query cancels et + * al., would also need to set set_latch_on_sigusr1. + */ + if (MyProc) + SetLatch(&MyProc->procLatch); + errno = save_errno; }