[Zope] ZMYSQLDA 2.0.9 lock problem

Dennis Allison allison at shasta.stanford.edu
Mon Jun 20 14:31:08 EDT 2005


IE, Zope 2.7.6, Python 2.4.1, MYSQLDA 2.0.9

One of our developers is reporting a curious problem, which I have not
been able to track down.  It appears to be threading related, somewhere 
in the ZBMYSQLDB adaptor.

The database connection string is bare of transaction indicators.  The 
database is local.  All tables are MyISAM which is non-transactioal.

Unfortunately the user does not remember the exact sequence of events
which generate the problem so I am unable to duplicate.  What we do know
is that the problem occurs at the beginning of a development session begun
with a cold boot of the client machine and a fresh browser and it occurs
once and only onece during the development session.  The developer
normally has two active Zope threads going--one working with the
application and one working with the ZMI.  He moves between them using the
Open/View tab and other buttons.  He reports that the first time he moves
focus from the ZMI to the application, he gets the following error:

-------------------------------------------------------------------
Time  2005/06/20 07:12:03.478 GMT-7
User Name (User Id) XXXX (XXXXX)
Request URL http://xxx.xxxxxxxx.com/logged_in
Exception Type error
Exception Value release unlocked lock

Traceback (innermost last):

    * Module ZPublisher.Publish, line 107, in publish
    * Module Zope.App.startup, line 222, in commit
    * Module ZODB.Transaction, line 260, in commit
    * Module ZODB.Transaction, line 377, in _finish_many
    * Module Shared.DC.ZRDB.TM, line 59, in tpc_finish
    * Module Products.ZMySQLDA.db, line 376, in _finish

error: release unlocked lock
--------------------------------------------------------------------

The lock being released is a transactional lock.  None of our locks should 
be transactional locks, given our setup.  I traced through the __init__()
method for DB and did not see how transactional locking could be 
specified so the lock relaease code could run--I must be missing 
something.  No thread in our system uses transactional locking as the 
tables do no support transactions.

The logged_in method references the MySQL database in several places; a 
couple of them are compound queries where multiple queries are joined 
by "<dtml-var mysql_delimiter>" values.  Many of our queries use this 
in combination with the "use <database name>" SQL query.   

The system is using ZODB filestorage (Data.fs) with ZEO and is pretty 
much out of the box.

Has anyone else encountrered a similar problem.  Any suggestions as to how 
to find this bug?  



More information about the Zope mailing list