Staging
v0.5.1
https://github.com/python/cpython
Revision 47cd10d7a903773f574fc93220dbca850067fa0c authored by Victor Stinner on 29 January 2015, 23:05:19 UTC, committed by Victor Stinner on 29 January 2015, 23:05:19 UTC
Issue #23347: send_signal(), kill() and terminate() methods of
BaseSubprocessTransport now check if the transport was closed and if the
process exited.

Issue #23347: Refactor creation of subprocess transports. Changes on
BaseSubprocessTransport:

* Add a wait() method to wait until the child process exit
* The constructor now accepts an optional waiter parameter. The _post_init()
  coroutine must not be called explicitly anymore. It makes subprocess
  transports closer to other transports, and it gives more freedom if we want
  later to change completly how subprocess transports are created.
* close() now kills the process instead of kindly terminate it: the child
  process may ignore SIGTERM and continue to run. Call explicitly terminate()
  and wait() if you want to kindly terminate the child process.
* close() now logs a warning in debug mode if the process is still running and
  needs to be killed
* _make_subprocess_transport() is now fully asynchronous again: if the creation
  of the transport failed, wait asynchronously for the process eixt. Before the
  wait was synchronous. This change requires close() to *kill*, and not
  terminate, the child process.
* Remove the _kill_wait() method, replaced with a more agressive close()
  method. It fixes _make_subprocess_transport() on error.
  BaseSubprocessTransport.close() calls the close() method of pipe transports,
  whereas _kill_wait() closed directly pipes of the subprocess.Popen object
  without unregistering file descriptors from the selector (which caused severe
  bugs).

These changes simplifies the code of subprocess.py.
1 parent 978a9af
History
Tip revision: 47cd10d7a903773f574fc93220dbca850067fa0c authored by Victor Stinner on 29 January 2015, 23:05:19 UTC
asyncio: sync with Tulip
Tip revision: 47cd10d
File Mode Size
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Python
Tools
.bzrignore -rw-r--r-- 584 bytes
.gitignore -rw-r--r-- 971 bytes
.hgeol -rw-r--r-- 800 bytes
.hgignore -rw-r--r-- 1.3 KB
.hgtags -rw-r--r-- 6.9 KB
.hgtouch -rw-r--r-- 1.2 KB
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 54.0 KB
README -rw-r--r-- 6.6 KB
config.guess -rwxr-xr-x 41.9 KB
config.sub -rwxr-xr-x 34.9 KB
configure -rwxr-xr-x 440.2 KB
configure.ac -rw-r--r-- 138.6 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 40.2 KB
setup.py -rw-r--r-- 95.2 KB

README

back to top