commit | 1c393e129f64661344de0eccd78c8a9f49ef3b46 | [log] [tgz] |
---|---|---|
author | Sergey Kandaurov <pluknet@nginx.com> | Wed Dec 29 22:29:23 2021 +0300 |
committer | Sergey Kandaurov <pluknet@nginx.com> | Wed Dec 29 22:29:23 2021 +0300 |
tree | 95a55dd76b64f5869c13125ab5c36eb56d074caf | |
parent | b9c4c2966aa4478f980d1100f1c1c92096fe9109 [diff] |
Tests: improved stop_daemons() to send signal again. As was observed, it's possible that a signal to complete a uwsgi daemon can be ignored while it is starting up, which results in tests hang due to eternal waiting on child processes termination. Notably, it is seen when running tests with a high number of prove jobs on a low-profile VM against nginx with broken modules and/or configuration. To reproduce: $ TEST_NGINX_GLOBALS=ERROR prove -j16 uwsgi*.t Inspecting uwsgi under ktrace on FreeBSD confirms that a SIGTERM signal is ignored at the very beginning of uwsgi startup. It is then replaced with a default action after listen(), thus waiting until uwsgi is ready to accept new TCP connections doesn't completely solve the hang window. The fix is to retry sending a signal some time after waitpid(WNOHANG) continuously demonstrated no progress with reaping a signaled process. It is modelled after f13ead27f89c that improved stop() for nginx.