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

Commitd038c6c

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 parentef1e125 commitd038c6c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎src/backend/postmaster/pgarch.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,16 @@ PgArchiverMain(int argc, char *argv[])
255255
staticvoid
256256
pgarch_exit(SIGNAL_ARGS)
257257
{
258-
/* SIGQUIT means curl up and die ... */
259-
exit(1);
258+
/*
259+
* We DO NOT want to run proc_exit() or atexit() callbacks; they wouldn't
260+
* be safe to run from a signal handler. Just nail the windows shut and
261+
* get out of town.
262+
*
263+
* For consistency with other postmaster children, we do _exit(2) not
264+
* _exit(1). The postmaster currently will treat these exit codes alike,
265+
* but it seems better to report that we died in an unexpected way.
266+
*/
267+
_exit(2);
260268
}
261269

262270
/* SIGHUP signal handler for archiver process */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp