-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SIGCHLD not reaped by uvloop when using subprocess protocol #128
Comments
If I replace the line
Looking at the code for UVProcessTransport.close (uvloop/handles/process.pyx), does self._close() close the libuv internal handle before it has had a chance to reap the child process? def close(self):
if self._returncode is None:
self._kill(uv.SIGKILL)
if self._stdin is not None:
self._stdin.close()
if self._stdout is not None:
self._stdout.close()
if self._stderr is not None:
self._stderr.close()
self._close() uvloop Issue #64 ("asyncio.get_child_watcher Not Working" ) is similar to this one. I think there's a race condition in the sample code provided, which is why it may not have been reproducible. |
Yeah, there's definitely a bug here. I don't have time to look at this right now 😞, but feel free to submit a PR. |
Well, one obvious solution is to simply remove |
* Fix subprocess.close() to let its processes die gracefully Fixes #128.
PYTHONASYNCIODEBUG
in env?: YesI'm seeing a difference of behavior between the default asyncio event loop and uvloop when using a subprocess. When my code closes a subprocess transport under uvloop, the protocol's connection_lost handler is not called. The child process continues to show up in 'ps' output as a zombie.
The same behavior happens under ubuntu linux 16.04, with python 3.5.2.
The source code for 'test_subprocess.py' is below.
uvloop output:
asyncio output:
test_subprocess.py:
The text was updated successfully, but these errors were encountered: