Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2017-06-12.13:29:17.846>created_at=<Date2017-06-07.15:21:05.658>labels= ['3.7', 'type-bug', 'library']
title='With forkserver, Process.exitcode does not get signal number'updated_at=<Date2017-06-30.08:37:05.015>user='https://github.com/pitrou'
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():
defpoll(self, flag=os.WNOHANG):
ifself.returncodeisNone:
frommultiprocessing.connectionimportwaittimeout=0ifflag==os.WNOHANGelseNoneifnotwait([self.sentinel], timeout):
returnNonetry:
self.returncode=forkserver.read_unsigned(self.sentinel)
except (OSError, EOFError):
# The process ended abnormally perhaps because of a signalself.returncode=255returnself.returncode
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: