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

Commitfb489e4

Browse files
committed
In bootstrap mode, use default signal handling for SIGINT etc.
Previously, the code pointed the standard process-termination signalsto postgres.c's die(). That would typically result in an attempt toexecute a transaction abort, which is not possible in bootstrap mode,leading to PANIC. This choice seems to be a leftover from an old codestructure in which the same signal-assignment code was used for manysorts of auxiliary processes, including interactive standalonebackends. It's not very sensible for bootstrap mode, which has nointerest in either interactivity or continuing after an error. We canget better behavior with less effort by just letting normal processtermination happen, after which the parent initdb process will clean up.This is basically cosmetic in any case, since initdb will react thesame way whether bootstrap dies on a signal or abort(). Given thelack of previous complaints, I don't feel a need to back-patch,even though the behavior is old.Discussion:https://postgr.es/m/3850b11a.5121.16aaf827e4a.Coremail.thunder1@126.com
1 parent037165c commitfb489e4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

‎src/backend/bootstrap/bootstrap.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,15 @@ bootstrap_signals(void)
558558
{
559559
Assert(!IsUnderPostmaster);
560560

561-
/* Set up appropriately for interactive use */
562-
pqsignal(SIGHUP,die);
563-
pqsignal(SIGINT,die);
564-
pqsignal(SIGTERM,die);
565-
pqsignal(SIGQUIT,die);
561+
/*
562+
* We don't actually need any non-default signal handling in bootstrap
563+
* mode; "curl up and die" is a sufficient response for all these cases.
564+
* Let's set that handling explicitly, as documentation if nothing else.
565+
*/
566+
pqsignal(SIGHUP,SIG_DFL);
567+
pqsignal(SIGINT,SIG_DFL);
568+
pqsignal(SIGTERM,SIG_DFL);
569+
pqsignal(SIGQUIT,SIG_DFL);
566570
}
567571

568572
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp