forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7634bd4
committed
Accept SIGQUIT during error recovery in auxiliary processes.
The bgwriter, checkpointer, walwriter, and walreceiver processesclaimed to allow SIGQUIT "at all times". In reality SIGQUITwould get re-blocked during error recovery, because we didn'tupdate the actual signal mask immediately, so sigsetjmp() wouldsave and reinstate a mask that includes SIGQUIT.This appears to be simply a coding oversight. There's never agood reason to hold off SIGQUIT in these processes, because it'sgoing to just call _exit(2) which should be safe enough, especiallysince the postmaster is going to tear down shared memory afterwards.Hence, stick in PG_SETMASK() calls to install the modified BlockSigmask immediately.Also try to improve the comments around sigsetjmp blocks. Most ofthem were just referencing postgres.c, which is misleading becauseactually postgres.c manages the signals differently.No back-patch, since there's no evidence that this is causing anyproblems in the field.Discussion:https://postgr.es/m/CALDaNm1d1hHPZUg3xU4XjtWBOLCrA+-2cJcLpw-cePZ=GgDVfA@mail.gmail.com1 parent3c99230 commit7634bd4
File tree
5 files changed
+65
-8
lines changed- src/backend
- postmaster
- replication
5 files changed
+65
-8
lines changedLines changed: 15 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
495 | 495 |
| |
496 | 496 |
| |
497 | 497 |
| |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
498 | 504 |
| |
499 | 505 |
| |
500 | 506 |
| |
| |||
1550 | 1556 |
| |
1551 | 1557 |
| |
1552 | 1558 |
| |
1553 |
| - | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
1554 | 1568 |
| |
1555 | 1569 |
| |
1556 | 1570 |
| |
|
Lines changed: 16 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
115 | 115 |
| |
116 | 116 |
| |
117 | 117 |
| |
118 |
| - | |
| 118 | + | |
119 | 119 |
| |
| 120 | + | |
120 | 121 |
| |
121 | 122 |
| |
122 | 123 |
| |
| |||
140 | 141 |
| |
141 | 142 |
| |
142 | 143 |
| |
143 |
| - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
144 | 158 |
| |
145 | 159 |
| |
146 | 160 |
| |
|
Lines changed: 16 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
209 | 209 |
| |
210 | 210 |
| |
211 | 211 |
| |
212 |
| - | |
| 212 | + | |
213 | 213 |
| |
| 214 | + | |
214 | 215 |
| |
215 | 216 |
| |
216 | 217 |
| |
| |||
231 | 232 |
| |
232 | 233 |
| |
233 | 234 |
| |
234 |
| - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
235 | 249 |
| |
236 | 250 |
| |
237 | 251 |
| |
|
Lines changed: 16 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
115 |
| - | |
| 115 | + | |
116 | 116 |
| |
| 117 | + | |
117 | 118 |
| |
118 | 119 |
| |
119 | 120 |
| |
| |||
129 | 130 |
| |
130 | 131 |
| |
131 | 132 |
| |
132 |
| - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
133 | 147 |
| |
134 | 148 |
| |
135 | 149 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
279 | 279 |
| |
280 | 280 |
| |
281 | 281 |
| |
282 |
| - | |
| 282 | + | |
283 | 283 |
| |
| 284 | + | |
284 | 285 |
| |
285 | 286 |
| |
286 | 287 |
| |
|
0 commit comments
Comments
(0)