aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/basics.source
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2014-10-04 21:25:41 -0400
committerRobert Haas <rhaas@postgresql.org>2014-10-04 22:15:06 -0400
commitc6fda5a19f7d43089801f445733d48ba2a7229d4 (patch)
tree8f5cc3de10a8ec02964184489981daa98dd50fe4 /src/tutorial/basics.source
parentbb7c8f99ac829c5fe5d3bd3a20b2642d55abdb62 (diff)
downloadpostgresql-c6fda5a19f7d43089801f445733d48ba2a7229d4.tar.gz
postgresql-c6fda5a19f7d43089801f445733d48ba2a7229d4.zip
Eliminate one background-worker-related flag variable.
Teach sigusr1_handler() to use the same test for whether a worker might need to be started as ServerLoop(). Aside from being perhaps a bit simpler, this prevents a potentially-unbounded delay when starting a background worker. On some platforms, select() doesn't return 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 of ServerLoop() won't be reached. This change ensures that, even in that case, background workers will eventually get launched. This is far from a perfect fix; really, we need select() to return control to ServerLoop() after an interrupt, either via the self-pipe trick or some other mechanism. But that's going to require more work and discussion, so let's do this for now to at least mitigate the damage. Per investigation of test_shm_mq failures on buildfarm member anole.
Diffstat (limited to 'src/tutorial/basics.source')
0 files changed, 0 insertions, 0 deletions