Re: [ZODB-Dev] Deadlock in ZODB/DB.py?

2006-10-09 Thread Tim Peters

[Christian Zagrodnick]

the DB.open method makes me wonder how it works (http://svn.zope.org/
ZODB/trunk/src/ZODB/DB.py?rev=69551&view=auto)

It locks with self._a() and calls self._connectionMap which locks
too. I cannot imagine a way this could possibly work.


Look at __init__():

   x = threading.RLock()
   self._a = x.acquire
   self._r = x.release

That is, it's a reentrant lock.  See the Python docs for RLock().


I guess the lock should be released before the _connectionMap call?


No.


Interestingly both all the tests pass and ZODB works...


That was a good clue ;-)
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] Deadlock in ZODB/DB.py?

2006-10-09 Thread Christian Zagrodnick

Hi there,

the DB.open method makes me wonder how it works (http://svn.zope.org/ 
ZODB/trunk/src/ZODB/DB.py?rev=69551&view=auto)


It locks with self._a() and calls self._connectionMap which locks  
too. I cannot imagine a way this could possibly work.


I guess the lock should be released before the _connectionMap call?

Interestingly both all the tests pass and ZODB works...


--
Christian Zagrodnick

gocept gmbh & co. kg  ·  forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891






smime.p7s
Description: S/MIME cryptographic signature
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev