[New-bugs-announce] [issue7292] Multiprocessing Joinable race condition?

Jonathan report at bugs.python.org
Mon Nov 9 07:31:26 CET 2009

New submission from Jonathan <jonathan at kc8onw.net>:

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):
            if not self._unfinished_tasks.acquire(False):
                raise ValueError('task_done() called too many times')
            if self._unfinished_tasks._semlock._is_zero():

components: None
messages: 95059
nosy: jonathan at kc8onw.net
severity: normal
status: open
title: Multiprocessing Joinable race condition?
type: behavior
versions: Python 3.1

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list