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: multiprocessing.Queue prevents program exit when containing a reasonable amount of data
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Dominik Schmid, davin, pitrou
Priority: normal Keywords:

Created on 2020-09-11 10:37 by Dominik Schmid, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
queue_busted.py Dominik Schmid, 2020-09-11 10:37
Messages (1)
msg376716 - (view) Author: Dominik Schmid (Dominik Schmid) Date: 2020-09-11 10:37
Reproduction steps: run the attached queue_busted.py

expected result: 
"done." is printed and the program terminates.

actual result:
"done." is printed and the program does not terminate.

Documentation link for your convenience:
https://docs.python.org/3.7/library/multiprocessing.html#multiprocessing.Queue.close

The lowest to trigger the bug seems to be 1639 42's in the queue.
If I put numpy.array([42]) into the queue instead of 42, I need much fewer items to trigger the bug.
When q.close() is called explicitly, it always terminates but sometimes prints a BrokenPipeError.

Reproduced on windows (Python 3.7.2) and Debian (Python 2.7.16).
History
Date User Action Args
2022-04-11 14:59:35adminsetgithub: 85927
2020-09-17 06:23:09Dominik Schmidsetnosy: + pitrou, davin
2020-09-11 10:37:24Dominik Schmidcreate