the os.wait() wrapper in eventlet would not block if no child processes
had exited. This was clearly buggy behaviour and os.wait() no blocks
correctly. However, it appears it now does not return if the parent process
was interrupted by a signal. This means that you can't kill the parent process
and have the child processes cleaned up gracefully.
To avoid all these issues, switch to non-blocking wait behaviour. We use
WNOHANG with waitpid() to poll for an exited child process and, if there
is none, we yield to other green threads and sleep for a short period.
This means excessive CPU usage, though, which will be tracked by bug #1095346.
Check pid to avoid some unnecessary warning/info messages in the logs
Reviewed: https:/ /review. openstack. org/18689 github. com/openstack/ oslo-incubator/ commit/ ffeb08550856170 95f19296770a122 3cb5641d1c
Committed: http://
Submitter: Jenkins
Branch: master
commit ffeb08550856170 95f19296770a122 3cb5641d1c
Author: Davanum Srinivas <email address hidden>
Date: Thu Dec 27 12:22:56 2012 -0500
Don't rely on os.wait() blocking
Before this fix which was included in eventlet 0.10.0:
https:/ /bitbucket. org/which_ linden/ eventlet/ issue/92/ eventletgreen- override- of-oswaitpid
the os.wait() wrapper in eventlet would not block if no child processes
had exited. This was clearly buggy behaviour and os.wait() no blocks
correctly. However, it appears it now does not return if the parent process
was interrupted by a signal. This means that you can't kill the parent process
and have the child processes cleaned up gracefully.
To avoid all these issues, switch to non-blocking wait behaviour. We use
WNOHANG with waitpid() to poll for an exited child process and, if there
is none, we yield to other green threads and sleep for a short period.
This means excessive CPU usage, though, which will be tracked by
bug #1095346.
Check pid to avoid some unnecessary warning/info messages in the logs
Fixes LP #1094076
Change-Id: I783fac652376c2 daa9d591403b9f4 c1fe9523043