New submission from Simon Jagoe: At Enthought we have been tracking a deadlock in some code that turned out to be due to the following scenario:
0) There is some cyclic garbage that requires collection; an object in the garbage is referred to by a weakref with a callback 1) You have a lock that is acquired 2) While the lock is held, the garbage collector runs (on the same thread) 3) The weakref callback in (0) is called via the garbage collecter and the callback tries to acquire the same lock that was acquired in (1) Attached is a simple script that exercises the issue in Python 3.3. The script monkey-patches Queue.get to force garbage collection after acquiring the Queue.not_empty lock. ---------- components: Library (Lib) files: executor-hang.py messages: 214380 nosy: simon.jagoe priority: normal severity: normal status: open title: Potential deadlock in concurrent futures when garbage collection occurs during Queue.get type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file34551/executor-hang.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21009> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com