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: Items put on Queue in thread in child process sometimes not seen by parent process
Type: Stage:
Components: Versions: Python 3.10, Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: alexmojaki
Priority: normal Keywords:

Created on 2020-08-22 11:42 by alexmojaki, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
queue_bug.py alexmojaki, 2020-08-22 11:42 A script you can run to observe this bug, with extensive comments
Messages (1)
msg375795 - (view) Author: Alex Hall (alexmojaki) Date: 2020-08-22 11:42
See attached file. The summary is that I start a Process, which starts a Thread, which puts some values on a Queue which was originally created by the parent process and passed down. Usually this works but occasionally the parent process doesn't see the items on the queue: queue.get() times out and queue.empty() is True, although queue.qsize() is accurate.

I can reproduce this on master:

Python 3.10.0a0 (heads/master:802726a, Aug 22 2020, 12:56:09) 
[GCC 7.5.0] on linux

as well as other versions I have installed which I've selected. On 3.6 it seems like the problem is even worse and some of my comments don't apply.

I've tested the script on Ubuntu 18.04.4, but the general problem seems to also happen on OSX although I can't confirm that now.
History
Date User Action Args
2022-04-11 14:59:35adminsetgithub: 85780
2020-08-22 11:42:15alexmojakicreate