issue #201: parent: log a warning and work around race for now.

This commit is contained in:
David Wilson 2018-04-21 17:51:59 +01:00
parent 9fe14e841c
commit cbe6be449e
1 changed files with 10 additions and 1 deletions

View File

@ -26,6 +26,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import errno
import fcntl
import getpass
import inspect
@ -593,7 +594,15 @@ class Stream(mitogen.core.Stream):
# on_disconnect() call.
return
pid, status = os.waitpid(self.pid, os.WNOHANG)
try:
pid, status = os.waitpid(self.pid, os.WNOHANG)
except OSError:
e = sys.exc_info()[1]
if e.args[0] == errno.ECHILD:
LOG.warn('%r: waitpid(%r) produced ECHILD', self.pid, self)
return
raise
if pid:
LOG.debug('%r: child process exit status was %d', self, status)
else: