[issue33997] multiprocessing Pool hangs in terminate()

2018-06-29 Thread Erik Wolf


New submission from Erik Wolf :

The terminate() method of multiprocessing.Pool hangs sporadically.
I could track this issue down to the fact that _handle_results() hangs in the 
outqueue-cleanup. poll() returned True but get() actually hangs endlessly never 
returning any data.

--
components: Windows
messages: 320713
nosy: Erik Wolf, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: multiprocessing Pool hangs in terminate()
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 
<https://bugs.python.org/issue33997>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33997] multiprocessing Pool hangs in terminate()

2018-06-29 Thread Erik Wolf


Erik Wolf  added the comment:

To help get an idea of the racing condition I created a trace with several 
additional debug outputs in pool.py and connection.py

"=== Creating new pool ===" marks a new start of a pool using the 
Pool.imap() function. The iteration is terminated at some time and a new pool 
is created with a new call to imap(). The last log entry shows the location of 
the last call which currently hangs endlessly.

I am not a multithreading/winapi expert so I could not fix the actual issue 
with _winapi.WaitForMultipleObjects but the fix in the PR actually ignores 
preceding issues when polling more data than actually needed for the two 
sentinels.

Remark: I have also seen this issue in linux with the same application but was 
not able to debug it so far.

--
Added file: https://bugs.python.org/file47659/debug.trace

___
Python tracker 
<https://bugs.python.org/issue33997>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com