forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit27b2c6a
committed
Don't launch new child processes after we've been told to shut down.
Once we've received a shutdown signal (SIGINT or SIGTERM), we should notlaunch any more child processes, even if we get signals requesting such.The normal code path for spawning backends has always understood that,but the postmaster's infrastructure for hot standby and autovacuum didn'tget the memo. As reported by Hari Babu in bug #7643, this could lead tofailure to shut down at all in some cases, such as when SIGINT is receivedjust before the startup process sends PMSIGNAL_RECOVERY_STARTED: we'dlaunch a bgwriter and checkpointer, and then those processes would have noidea that they ought to quit. Similarly, launching a new autovacuum workerwould result in waiting till it finished before shutting down.Also, switch the order of the code blocks in reaper() that detect startupprocess crash versus shutdown termination. Once we've sent it a signal,we should not consider that exit(1) is surprising. This is just a cosmeticfix since shutdown occurs correctly anyway, but better not to log a phonycomplaint about startup process crash.Back-patch to 9.0. Some parts of this might be applicable before that,but given the lack of prior complaints I'm not going to worry too muchabout older branches.1 parent5cb0e33 commit27b2c6a
1 file changed
+23
-20
lines changedLines changed: 23 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2261 | 2261 |
| |
2262 | 2262 |
| |
2263 | 2263 |
| |
2264 |
| - | |
2265 |
| - | |
2266 |
| - | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
2267 | 2267 |
| |
2268 | 2268 |
| |
2269 | 2269 |
| |
| |||
2354 | 2354 |
| |
2355 | 2355 |
| |
2356 | 2356 |
| |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
2357 | 2369 |
| |
2358 | 2370 |
| |
2359 | 2371 |
| |
| |||
2368 | 2380 |
| |
2369 | 2381 |
| |
2370 | 2382 |
| |
2371 |
| - | |
2372 |
| - | |
2373 |
| - | |
2374 |
| - | |
2375 |
| - | |
2376 |
| - | |
2377 |
| - | |
2378 |
| - | |
2379 |
| - | |
2380 |
| - | |
2381 |
| - | |
2382 |
| - | |
2383 | 2383 |
| |
2384 | 2384 |
| |
2385 | 2385 |
| |
| |||
4283 | 4283 |
| |
4284 | 4284 |
| |
4285 | 4285 |
| |
4286 |
| - | |
| 4286 | + | |
4287 | 4287 |
| |
4288 | 4288 |
| |
4289 | 4289 |
| |
| |||
4300 | 4300 |
| |
4301 | 4301 |
| |
4302 | 4302 |
| |
4303 |
| - | |
| 4303 | + | |
4304 | 4304 |
| |
4305 | 4305 |
| |
4306 | 4306 |
| |
| |||
4331 | 4331 |
| |
4332 | 4332 |
| |
4333 | 4333 |
| |
4334 |
| - | |
| 4334 | + | |
| 4335 | + | |
4335 | 4336 |
| |
4336 | 4337 |
| |
4337 | 4338 |
| |
| |||
4345 | 4346 |
| |
4346 | 4347 |
| |
4347 | 4348 |
| |
4348 |
| - | |
| 4349 | + | |
| 4350 | + | |
4349 | 4351 |
| |
4350 | 4352 |
| |
4351 | 4353 |
| |
| |||
4354 | 4356 |
| |
4355 | 4357 |
| |
4356 | 4358 |
| |
4357 |
| - | |
| 4359 | + | |
| 4360 | + | |
4358 | 4361 |
| |
4359 | 4362 |
| |
4360 | 4363 |
| |
|
0 commit comments
Comments
(0)