forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc6fda5a
committed
Eliminate one background-worker-related flag variable.
Teach sigusr1_handler() to use the same test for whether a workermight need to be started as ServerLoop(). Aside from being perhapsa bit simpler, this prevents a potentially-unbounded delay whenstarting a background worker. On some platforms, select() doesn'treturn when interrupted by a signal, but is instead restarted,including a reset of the timeout to the originally-requested value.If signals arrive often enough, but no connection requests arrive,sigusr1_handler() will be executed repeatedly, but the body ofServerLoop() won't be reached. This change ensures that, even inthat case, background workers will eventually get launched.This is far from a perfect fix; really, we need select() to returncontrol to ServerLoop() after an interrupt, either via the self-pipetrick or some other mechanism. But that's going to require morework and discussion, so let's do this for now to at least mitigatethe damage.Per investigation of test_shm_mq failures on buildfarm member anole.1 parentbb7c8f9 commitc6fda5a
1 file changed
+3
-4
lines changedLines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4757 | 4757 |
| |
4758 | 4758 |
| |
4759 | 4759 |
| |
4760 |
| - | |
4761 | 4760 |
| |
4762 | 4761 |
| |
4763 | 4762 |
| |
4764 | 4763 |
| |
4765 | 4764 |
| |
4766 | 4765 |
| |
4767 | 4766 |
| |
4768 |
| - | |
| 4767 | + | |
4769 | 4768 |
| |
4770 | 4769 |
| |
4771 | 4770 |
| |
| |||
4806 | 4805 |
| |
4807 | 4806 |
| |
4808 | 4807 |
| |
4809 |
| - | |
| 4808 | + | |
4810 | 4809 |
| |
4811 | 4810 |
| |
4812 |
| - | |
| 4811 | + | |
4813 | 4812 |
| |
4814 | 4813 |
| |
4815 | 4814 |
| |
|
0 commit comments
Comments
(0)