diff options
Diffstat (limited to 'src/backend/replication/walreceiver.c')
-rw-r--r-- | src/backend/replication/walreceiver.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index c1e439adb40..c36bcc08ec7 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -43,7 +43,6 @@ */ #include "postgres.h" -#include <signal.h> #include <unistd.h> #include "access/htup_details.h" @@ -58,6 +57,7 @@ #include "libpq/pqsignal.h" #include "miscadmin.h" #include "pgstat.h" +#include "postmaster/interrupt.h" #include "replication/walreceiver.h" #include "replication/walsender.h" #include "storage/ipc.h" @@ -127,7 +127,6 @@ static void ProcessWalSndrMessage(XLogRecPtr walEnd, TimestampTz sendTime); /* Signal handlers */ static void WalRcvSigHupHandler(SIGNAL_ARGS); static void WalRcvShutdownHandler(SIGNAL_ARGS); -static void WalRcvQuickDieHandler(SIGNAL_ARGS); /* @@ -249,7 +248,7 @@ WalReceiverMain(void) pqsignal(SIGHUP, WalRcvSigHupHandler); /* set flag to read config file */ pqsignal(SIGINT, SIG_IGN); pqsignal(SIGTERM, WalRcvShutdownHandler); /* request shutdown */ - pqsignal(SIGQUIT, WalRcvQuickDieHandler); /* hard crash time */ + pqsignal(SIGQUIT, SignalHandlerForCrashExit); pqsignal(SIGALRM, SIG_IGN); pqsignal(SIGPIPE, SIG_IGN); pqsignal(SIGUSR1, procsignal_sigusr1_handler); @@ -781,32 +780,6 @@ WalRcvShutdownHandler(SIGNAL_ARGS) } /* - * WalRcvQuickDieHandler() occurs when signalled SIGQUIT by the postmaster. - * - * Some backend has bought the farm, so we need to stop what we're doing and - * exit. - */ -static void -WalRcvQuickDieHandler(SIGNAL_ARGS) -{ - /* - * We DO NOT want to run proc_exit() or atexit() callbacks -- we're here - * because shared memory may be corrupted, so we don't want to try to - * clean up our transaction. Just nail the windows shut and get out of - * town. The callbacks wouldn't be safe to run from a signal handler, - * anyway. - * - * Note we use _exit(2) not _exit(0). This is to force the postmaster - * into a system reset cycle if someone sends a manual SIGQUIT to a random - * backend. This is necessary precisely because we don't clean up our - * shared memory state. (The "dead man switch" mechanism in pmsignal.c - * should ensure the postmaster sees this as a crash, too, but no harm in - * being doubly sure.) - */ - _exit(2); -} - -/* * Accept the message from XLOG stream, and process it. */ static void |