[ZODB-Dev] error: release unlocked lock

JohnD.Heintz JohnD.Heintz
Mon, 6 Aug 2001 17:39:41 -0500


Can you redefine any exceptions that are meant to be retried in terms of =
the=20
POSExceptions?  And then let us know which of those are intended to be=20
retried and which are final exceptions?

I too am getting this exception (but only on Windows) and need a way to r=
etry=20
it without retrying for *any* exception that occurs.

John

On Monday 06 August 2001 17:17, Jeremy Hylton wrote:
> >>>>> "CW" =3D=3D Chris Withers <chrisw@nipltd.com> writes:
>
>   CW> Hi, This is with Zope 2.4.0b3 and ZEO 1.0b3:
> > Traceback (most recent call last):
> >     get_transaction().commit()
> >    File "C:\Zope\2-4-0B~2\lib\python\ZODB\Transaction.py", line 301, =
in
> > commit j.tpc_begin(self)
> >    File "C:\Zope\2-4-0B~2\lib\python\ZODB\Connection.py", line 633, i=
n
> > tpc_begin self._storage.tpc_begin(transaction)
> >    File "C:\zope\2-4-0b2_base\lib\python\ZEO\ClientStorage.py", line =
482,
> > in tpc_begin self._commit_lock_release()
> >  error: release unlocked lock
>
>   CW> What does this mean?
>
> Literally, it means that the commit lock was not held when release was
> called.  If you get this bug, you should treat it like a ConflictError
> (or other non-fatal ZODB exceptions) and retry the transaction.
>
>   CW> Why is it happening?
>
> The commit lock is used to guarantee that only a single transaction
> commits at one time if the client has multiple connections.  It is
> normally released after a tpc_finish() or tpc_abort().
>
> I expect it's happening because something is causing the ZEO
> connection to be reset.  If a client disconnects from a storage
> unexpectedly, say because a socket error occurs, the RPC layer cause
> an exception to be returned from the next call and it will release the
> commit lock.  The logic here is that if a transaction is currently
> committing and the connection has closed, we need to be absolutely
> sure that the commit lock is released.  Otherwise, the client would be
> unable to commit new transactions.
>
> The problem is that a socket error can occur while the client is
> connecting.  If this happens, the release call can be made while the
> lock isn't held.
>
> This is a bug of sorts, but hopefully not to deep.  You should be
> getting some other exception.
>
>   CW> How can I make it stop?
>
> How often are you seeing this problem?  I expected that socket errors
> during connection would be quite rare.  I'd like to diagnose your
> problem better and see if there is some other bug lurking that ought
> to be fixed before ZEO 1.0 final.
>
> One possibilty is the patch I've included below, which should prevent
> the commit_lock_release error.  I haven't tested it much, so I
> wouldn't try it in a production environment.  (More of a might-help
> than a will-help.)
>
> Jeremy
>
>
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
>
> ZODB-Dev mailing list  -  ZODB-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zodb-dev

--=20
=2E . . . . . . . . . . . . . . . . . . . . . . .

John D. Heintz | Senior Engineer

1016 La Posada Dr. | Suite 240 | Austin TX 78752
T 512.633.1198 | jheintz@isogen.com

w w w . d a t a c h a n n e l . c o m