Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbedadc7

Browse files
committed
Make archiver's SIGQUIT handler exit via _exit().
Commit8e19a82 changed the SIGQUIT handlers of almost all serverprocesses not to run atexit callbacks. The archiver process wasskipped, perhaps because it's not connected to shared memory; butit's just as true here that running atexit callbacks in a signalhandler is unsafe. So let's make it work like the rest.In HEAD and v13, we can use the common SignalHandlerForCrashExithandler. Before that, just tweak pgarch_exit to use _exit(2)explicitly.Like the previous commit, back-patch to all supported branches.Kyotaro Horiguchi, back-patching by meDiscussion:https://postgr.es/m/1850884.1599601164@sss.pgh.pa.us
1 parent0aa8f76 commitbedadc7

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

‎src/backend/postmaster/pgarch.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ static pid_t pgarch_forkexec(void);
9696
#endif
9797

9898
NON_EXEC_STATICvoidPgArchiverMain(intargc,char*argv[])pg_attribute_noreturn();
99-
staticvoidpgarch_exit(SIGNAL_ARGS);
10099
staticvoidpgarch_waken(SIGNAL_ARGS);
101100
staticvoidpgarch_waken_stop(SIGNAL_ARGS);
102101
staticvoidpgarch_MainLoop(void);
@@ -229,7 +228,7 @@ PgArchiverMain(int argc, char *argv[])
229228
pqsignal(SIGHUP,SignalHandlerForConfigReload);
230229
pqsignal(SIGINT,SIG_IGN);
231230
pqsignal(SIGTERM,SignalHandlerForShutdownRequest);
232-
pqsignal(SIGQUIT,pgarch_exit);
231+
pqsignal(SIGQUIT,SignalHandlerForCrashExit);
233232
pqsignal(SIGALRM,SIG_IGN);
234233
pqsignal(SIGPIPE,SIG_IGN);
235234
pqsignal(SIGUSR1,pgarch_waken);
@@ -246,14 +245,6 @@ PgArchiverMain(int argc, char *argv[])
246245
exit(0);
247246
}
248247

249-
/* SIGQUIT signal handler for archiver process */
250-
staticvoid
251-
pgarch_exit(SIGNAL_ARGS)
252-
{
253-
/* SIGQUIT means curl up and die ... */
254-
exit(1);
255-
}
256-
257248
/* SIGUSR1 signal handler for archiver process */
258249
staticvoid
259250
pgarch_waken(SIGNAL_ARGS)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp