New submission from Tom Ashley <tomash...@protonmail.com>:

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

----------
components: Interpreter Core
files: brokenPool.py
messages: 326922
nosy: TensorTom
priority: normal
severity: normal
status: open
title: Inconsistent Behavior Of futures.ProcessPoolExecutor
versions: Python 3.7
Added file: https://bugs.python.org/file47843/brokenPool.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34877>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to