New submission from Justin Lebar <justin.le...@gmail.com>:

>From https://bugs.python.org/issue1187312 about regular subprocesses:

> So as long as the application keeps a reference to the
> subprocess object, it can wait for it; auto-reaping only
> starts when the last reference was dropped [in Popen.__del__].

asyncio subprocesses seem to behave differently.  When we notice the process 
has exited in BaseSubprocessTransport._process_exited, we call _try_finish(), 
which -- if all pipes are closed -- calls _call_connection_lost and sets 
self._proc to None.

At this point, my understanding is that once self._proc is GC'ed, we'll run 
Popen.__del__ and may reap the pid.

I would expect asyncio subprocesses to behave the same way as regular Popen 
objects wrt pid reaping.

----------
components: asyncio
messages: 365095
nosy: Justin.Lebar, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: asyncio subprocesses allow pids to be reaped, different behavior than 
regular subprocesses

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40078>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to