Issue 34877: Inconsistent Behavior Of futures.ProcessPoolExecutor (original) (raw)
Not sure if this goes in core or modules.
There is an inconsistency in the output of the attached script. From the docs I read it's supposed to have the behavior of:
"If something happens to one of the worker processes to cause it to exit unexpectedly, the ProcessPoolExecutor is considered “broken” and will no longer schedule tasks."
That script is supposed to exemplify that. Instead, if I run the code several times, I get the following output:
(bot-LP2ewIkY) ⋊> ~/w/p/b/bot on master ⨯ python brokenPool.py 18:54:55 getting the pid for one worker killing process 4373 submitting another task could not start new tasks: A process in the process pool was terminated abruptly while the future was running or pending. (bot-LP2ewIkY) ⋊> ~/w/p/b/bot on master ⨯ python brokenPool.py 18:54:56 getting the pid for one worker killing process 4443 submitting another task could not start new tasks: A process in the process pool was terminated abruptly while the future was running or pending. (bot-LP2ewIkY) ⋊> ~/w/p/b/bot on master ⨯ python brokenPool.py 18:54:57 getting the pid for one worker killing process 4514 submitting another task <----- (No exception thrown after this)
The exception isn't always thrown. This seems problematic to me. Related stack post: https://stackoverflow.com/questions/52617558/python-inconsistent-behavior-of-futures-processpoolexecutor