In multiprocessing.JoinableQueue when task_done is called
self._unfinished_tasks.acquire(False) is called non-blocking. My
program reliably crashes with the "task_done() called too many times"
message. If I change the .acquire() call to True (blocking) then my
program no longer crashes and I have not noticed any adverse effects. I
don't know if this would be considered a race condition or something
else but it does lead to crashes even in correct use scenarios.
(Code snippet follows for context, line 292 is the critical one for me)
def task_done(self):
self._cond.acquire()
try:
if not self._unfinished_tasks.acquire(False):
raise ValueError('task_done() called too many times')
if self._unfinished_tasks._semlock._is_zero():
|