classification
Title: Multiprocessing Joinable race condition?
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 3.2, Python 3.1, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: jnoller Nosy List: asksol, jnoller, jonathan
Priority: normal Keywords:

Created on 2009-11-09 06:31 by jonathan, last changed 2010-11-02 14:36 by asksol.

Messages (1)
msg95059 - (view) Author: Jonathan (jonathan) Date: 2009-11-09 06:31
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():
History
Date User Action Args
2010-11-02 14:36:14asksolsetnosy: + asksol
2010-07-11 10:17:09BreamoreBoysetversions: + Python 2.7, Python 3.2
nosy: + jnoller

assignee: jnoller
components: + Library (Lib), - None
stage: test needed
2009-11-09 06:31:24jonathancreate