[issue19310] asyncio: fix waitpid() logic

Charles-François Natali report at bugs.python.org
Sun Oct 20 12:33:29 CEST 2013


New submission from Charles-François Natali:

The current SIGCHILD handler has two bugs:
- it reschedules itself if waitpid() returns 0: so if this ever happens, it will enter a busy-loop until all children have exited
- it doesn't reschedule itself if waitpid() succeeds in reaping a child: since signals can be coalesced, we must keep calling waitpid() as long as it succeeds, since the incoming SIGCHLD signal could actually be due to more than one child exited (and there won't be a SIGCHILD coming later for the processes we didn't wait right away).

----------
components: Library (Lib)
files: asyncio_waitpid_loop.diff
keywords: needs review, patch
messages: 200561
nosy: gvanrossum, neologix
priority: normal
severity: normal
stage: patch review
status: open
title: asyncio: fix waitpid() logic
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file32242/asyncio_waitpid_loop.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19310>
_______________________________________


More information about the Python-bugs-list mailing list