forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5d8117e
committed
Block signals earlier during postmaster startup.
Formerly, we set up the postmaster's signal handling only when we wereabout to start launching subprocesses. This is a bad idea though, asit means that for example a SIGINT arriving before that will kill thepostmaster instantly, perhaps leaving lockfiles, socket files, sharedmemory, etc laying about. We'd rather that such a signal caused orderlypostmaster termination including releasing of those resources. A simplefix is to move the PostmasterMain stanza that initializes signal handlingto an earlier point, before we've created any such resources. Then, anearly-arriving signal will be blocked until we're ready to deal with itin the usual way. (The only part that really needs to be moved up isblocking of signals, but it seems best to keep the signal handlerinstallation calls together with that; for one thing this ensures thekernel won't drop any signals we wished to get. The handlers won't getinvoked in any case until we unblock signals in ServerLoop.)Per a report from MauMau. He proposed changing the way "pg_ctl stop"works to deal with this, but that'd just be masking one symptom notfixing the core issue.It's been like this since forever, so back-patch to all supported branches.1 parentffbba6e commit5d8117e
1 file changed
+30
-30
lines changedLines changed: 30 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
561 | 561 |
| |
562 | 562 |
| |
563 | 563 |
| |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
564 | 594 |
| |
565 | 595 |
| |
566 | 596 |
| |
| |||
1108 | 1138 |
| |
1109 | 1139 |
| |
1110 | 1140 |
| |
1111 |
| - | |
1112 |
| - | |
1113 |
| - | |
1114 |
| - | |
1115 |
| - | |
1116 |
| - | |
1117 |
| - | |
1118 |
| - | |
1119 |
| - | |
1120 |
| - | |
1121 |
| - | |
1122 |
| - | |
1123 |
| - | |
1124 |
| - | |
1125 |
| - | |
1126 |
| - | |
1127 |
| - | |
1128 |
| - | |
1129 |
| - | |
1130 |
| - | |
1131 |
| - | |
1132 |
| - | |
1133 |
| - | |
1134 |
| - | |
1135 |
| - | |
1136 |
| - | |
1137 |
| - | |
1138 |
| - | |
1139 |
| - | |
1140 |
| - | |
1141 | 1141 |
| |
1142 | 1142 |
| |
1143 | 1143 |
| |
|
0 commit comments
Comments
(0)