[New-bugs-announce] [issue35860] ProcessPoolExecutor subprocesses crash & break pool when raising an exception with keyword-only args and an arg passed to Exception
Bence Nagy
report at bugs.python.org
Wed Jan 30 11:06:56 EST 2019
New submission from Bence Nagy <bence at underyx.me>:
ProcessPoolExecutor's subprocesses normally transparently proxy exceptions
raised within a child to the parent process.
One special case I bumped into however causes a crash
within the stdlib code responsible for communication.
The special case is triggered when both of these are true:
1) The exception being raised uses `*` to mark arguments as keyword-only
2) The exception being raised sets a positional argument for Exception: `super().__init__("test")`
I have attached a file which demonstrates what happens
when only 1), only 2), and both 1) and 2) are true.
Running the file with Python 3.7.2 will result in this output:
```
<function works1 at 0x1010070d0> raised Works1('test')
<function works2 at 0x1016ae2f0> raised Works2()
<function breaks at 0x1016ae378> raised BrokenProcessPool('A process in the process pool was terminated abruptly while the future was running or pending.')
```
The expected result for the third call would be keeping the executor usable and printing this:
```
<function breaks at 0x1016ae378> raised Breaks('test')
```
----------
components: Library (Lib)
files: ppe_crash.py
messages: 334570
nosy: underyx
priority: normal
severity: normal
status: open
title: ProcessPoolExecutor subprocesses crash & break pool when raising an exception with keyword-only args and an arg passed to Exception
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48086/ppe_crash.py
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35860>
_______________________________________
More information about the New-bugs-announce
mailing list