Skip to content

Commit 0bf8eb2

Browse files
committed
Fix walsender processes to establish a SIGALRM handler.
Walsenders must have working SIGALRM handling during InitPostgres, but they set the handler to SIG_IGN so that nothing would happen if a timeout was reached. This could result in two failure modes: * If a walsender participated in a deadlock during its authentication transaction, and was the last to wait in the deadly embrace, the deadlock would not get cleared automatically. This would require somebody to be trying to take out AccessExclusiveLock on multiple system catalogs, so it's not very probable. * If a client failed to respond to a walsender's authentication challenge, the intended disconnect after AuthenticationTimeout wouldn't happen, and the walsender would wait indefinitely for the client. For the moment, fix in back branches only, since this is fixed in a different way in the timeout-infrastructure patch that's awaiting application to HEAD. If we choose not to apply that, then we'll need to do this in HEAD as well.
1 parent 4810ebe commit 0bf8eb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/replication/walsender.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ WalSndSignals(void)
13701370
pqsignal(SIGINT, SIG_IGN); /* not used */
13711371
pqsignal(SIGTERM, WalSndShutdownHandler); /* request shutdown */
13721372
pqsignal(SIGQUIT, WalSndQuickDieHandler); /* hard crash time */
1373-
pqsignal(SIGALRM, SIG_IGN);
1373+
pqsignal(SIGALRM, handle_sig_alarm);
13741374
pqsignal(SIGPIPE, SIG_IGN);
13751375
pqsignal(SIGUSR1, WalSndXLogSendHandler); /* request WAL sending */
13761376
pqsignal(SIGUSR2, WalSndLastCycleHandler); /* request a last cycle and

0 commit comments

Comments
 (0)