[ZODB-Dev] POSKeyError with Zope 2.7.2, suddenly appeared, thendisappeared...

Dieter Maurer dieter at handshake.de
Mon Feb 21 12:45:19 EST 2005


Hi Florent,

Florent Guillaume wrote at 2005-2-21 16:46 +0100:
>Dieter Maurer  <dieter at handshake.de> wrote:
>> >I can't agree that info level was inappropriate here, at least not without a
>> >lot more thought than I can give to it now.  A problem with ZEO is that
>> >people normally want a way to tell that ZEO is still _alive_ in info-level
>> >logs.  Logging info about transaction-lock activity is one natural way to do
>> >that (if you're doing transactions over ZEO, but not seeing those msgs, you
>> >can deduce that ZEO is dead or deadlocked or something; and looking then at
>> >the last lock activity logged can be a good clue about how things got
>> >hosed).
>> 
>> I changed this (in our private copy) and now
>> explicitly log when a transaction needs to wait for the
>> transaction lock (and what (user and description) is holding
>> this lock) and when it is restarted.
>
>Could you point me to where you added these logs? I'm trying to find the
>reason for a deadlock we have here...

In "ZODB.DB.DB.open":

                if c is None:
                    if waitflag:
                        self._r()
                        # DM 2005-01-26: improve understanding of connection leaks
                        #pool_lock.acquire()
                        if not pool_lock.acquire(0):
                            # waiting for connection to become free
                            LOG('ZODB.DB',
                                INFO,
                                'waiting for connection %s' % self.getName(),
                                )
                            pool_lock.acquire()
                            LOG('ZODB.DB',
                                INFO,
                                'got connection %s' % self.getName(),
                                )
                        self._a()

I replaced the "pool_lock.acquire()" with the conditional below it.

-- 
Dieter


More information about the ZODB-Dev mailing list