RE: AW: DorothyLocker and performance

"Garth T Kidd" <garth-OnzZ1s1DREKDegMON/[email protected]> Fri, 1 Oct 2004 07:35:11 +1000
Newsgroups gmane.comp.pythin.pyds.devel
Organization Deadly Bloody Serious
Message-ID <[email protected]>
I'm pondering whether to add *unwinding* to the feature list: if we detect
release failure in a subframe during release(), we could potentially log the
problem and then successfully release. The main issue is that without a
resounding crash, developers aren't necessarily going to know to check their
logs... 

So, the unit tests succeeded but there was a failure in PyDS? That's not so
good. What's your operating platform, Thomas? 

-----Original Message-----
From: pyds-dev-admin-iYtK5bfT9M//Ad8WF/[email protected]
[mailto:pyds-dev-admin-iYtK5bfT9M//Ad8WF/[email protected]] On Behalf Of Thomas Klaeger
Sent: Friday, 1 October 2004 1:01 AM
To: Garth T Kidd
Cc: 'Bauer, Georg'; 'PyDS Developer List (E-Mail)'
Subject: Re: AW: [Pyds-dev] DorothyLocker and performance

Hello Garth,

Garth T Kidd schrieb:
> Did the unit tests show anything before you applied your fix? If I 
> need another regression test, I'd like to add it. If not, it looks 
> like the code is in pretty good shape. All I need to do now is figure 
> out why ignoring self._acquire.func_code wasn't working in situ...

This was the only indication:

>>_acquire: 
>>Exception exceptions.AssertionError: 
>>('/opt/pyds/lib/python2.2/site-packages/PyDS/Tool.py', 1393, 
>>'_acquire', 'return self.lock.acquire(blocking)') 
>>('/opt/pyds/lib/python2.2/site-packages/PyDS/DorothyLocker.py', 342, 
>>'acquire', 'assert result # ... but you can never be too careful.')

the assert failed! Digging into the python documentation I found that
thread.lock.acquire() returns nothing if called without arguments. The
remaining error messages from below

>>-----------------------
>>ReleaseOfUnAcquiredLock
>>-----------------------
>>An attempt to release an un-acquired lock. Probably caused by failure 
>>to acquire.
>>Detection context:
>>  File "/opt/pyds/lib/python2.2/site-packages/PyDS/EventsTool.py",
>>line 93, in _log
>>  File "/opt/pyds/lib/python2.2/site-packages/PyDS/EventsTool.py",
>>line 99, in _logVerbose

... some stack trace cut off ...

>>line 290, in __sanity_check
>>    raise ReleaseOfUnAcquiredLock, (None, my_context)
>>ReleaseOfUnAcquiredLock: (None, <PyDS.DorothyLocker.CallingContext
>>object at
>>0x8927614>, 'An attempt to release an un-acquired lock. Probably 
>>0x8927614>caused by
>>failure to acquire.')
>>

stems from the fact that the code is written as

try:
     self.lock.acquire()
     ...
finally:
     self.lock.release()

which leads to the release of an unacquired lock if the locking itself
fails.

Regards,
Thomas

_______________________________________________
Pyds-dev mailing list
Pyds-dev-iYtK5bfT9M//Ad8WF/[email protected]
http://www.westfalen.de/cgi-bin/mailman/listinfo/pyds-dev