This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Inconsistent Behavior Of futures.ProcessPoolExecutor
Type: Stage:
Components: Interpreter Core Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: TensorTom, xtreak
Priority: normal Keywords:

Created on 2018-10-02 23:16 by TensorTom, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
brokenPool.py TensorTom, 2018-10-02 23:16 Example code
Messages (1)
msg326922 - (view) Author: Tom Ashley (TensorTom) Date: 2018-10-02 23:16
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
History
Date User Action Args
2022-04-11 14:59:06adminsetgithub: 79058
2018-10-03 00:15:28xtreaksetnosy: + xtreak
2018-10-02 23:16:54TensorTomcreate