Message295343
| Author |
pitrou |
| Recipients |
davin, pitrou, sbt |
| Date |
2017年06月07日.15:21:05 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1496848865.75.0.934922267474.issue30589@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The documentation for multiprocessing.exitcode says:
"""
The child’s exit code. This will be None if the process has not yet terminated. A negative value -N indicates that the child was terminated by signal N.
"""
This is true for the "fork" method, but not "forkserver" where a child terminated by a signal will get an exitcode of 255. This is because forkserver relies on the child writing its own exit code in a pipe, which obviously doesn't work if it was killed (255 is simply a fallback value).
See forkserver's Popen.poll():
def poll(self, flag=os.WNOHANG):
if self.returncode is None:
from multiprocessing.connection import wait
timeout = 0 if flag == os.WNOHANG else None
if not wait([self.sentinel], timeout):
return None
try:
self.returncode = forkserver.read_unsigned(self.sentinel)
except (OSError, EOFError):
# The process ended abnormally perhaps because of a signal
self.returncode = 255
return self.returncode |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2017年06月07日 15:21:05 | pitrou | set | recipients:
+ pitrou, sbt, davin |
| 2017年06月07日 15:21:05 | pitrou | set | messageid: <1496848865.75.0.934922267474.issue30589@psf.upfronthosting.co.za> |
| 2017年06月07日 15:21:05 | pitrou | link | issue30589 messages |
| 2017年06月07日 15:21:05 | pitrou | create |
|