In case this is a clue - the attached script "mp_hang2.py" adds a call to qsize() and uses only a single consumer. When I run it from the command line it does one of two things:
Option 1:
C:\TEMP\Py-3.7.2b-Venv\Scripts>.\python.exe "C:\Users\Tom.Wilson\Documents\Python-Bugs\mp_hang2.py"
Creating 1 consumers
Putting
Poisoning
Joining
Process Consumer-1:
Traceback (most recent call last):
File "C:\Users\Tom.Wilson\AppData\Local\Programs\Python\Python37\lib\multiprocessing\process.py", line 297, in _bootstrap
self.run()
File "C:\Users\Tom.Wilson\Documents\Python-Bugs\mp_hang2.py", line 18, in run
print(f'Queue size: {self.task_queue.qsize()}')
File "C:\Users\Tom.Wilson\AppData\Local\Programs\Python\Python37\lib\multiprocessing\queues.py", line 117, in qsize
return self._maxsize - self._sem._semlock._get_value()
PermissionError: [WinError 5] Access is denied
Option 2:
C:\TEMP\Py-3.7.2b-Venv\Scripts>.\python.exe "C:\Users\Tom.Wilson\Documents\Python-Bugs\mp_hang2.py"
Creating 1 consumers
Putting
Poisoning
Joining
Queue size: 2147483647
Getting task
<<< Hangs here >>>
If I can provide anything else please let me know. |