[Zope-Coders] Who killed the Zope HEAD?

Shane Hathaway shane@zope.com
Wed, 20 Mar 2002 10:15:06 -0500


Barry A. Warsaw wrote:
>>>>>>"SH" == Shane Hathaway <shane@zope.com> writes:
>>>>>>
> 
>     SH> Well, it turns out I already had all the latest stable code:
>     SH> Python 2.1.2, BerkeleyDB 3.3.11 with both patches, and bsddb3
>     SH> 3.3.0.  The freeze still happens.
> 
>     | So I did some further investigation.  The freeze happens in 
>     | bsddb3storage/Full.py, line 1103, which reads:
> 
>     SH>      self._metadata.delete(key)
> 
>     SH> This is called in the middle of _dopack().  I thought that
>     SH> maybe the _metadata table was being locked by a function
>     SH> calling this routine, and that the type of lock being used was
>     SH> not reentrant.  Sure enough, _dopack() gets a cursor for the
>     SH> _metadata table, which it uses before calling _zaprevision(),
>     SH> but it actually finishes with it first.  So I added a "del c"
>     SH> in the middle of _dopack(), and the tests passed again.
> 
> Shane!  Thanks so much for debugging this one!  Indeed, the hang in
> checkPackAllRevision() is reproducible for me too.
> 
> You're right that the _metadata cursor used in _dopack() was not being
> closed properly.  However, instead of deleting `c' and implicitly
> freeing that resource, I think it's better to wrap the use of the
> cursor in a try/finally that ensures the cursor is closed (similar to
> the idiom used elsewhere in the file).  See attached patch; a complete
> cvs-up'd unit test for me now passes.  Please try it and if it works
> for you (guys), I'll commit the change.  (It's really just a 3 line
> change, but that's masked by the re-indentation.)

Thanks, that is a better patch.  It works for me.

BTW why is checkVersionIterator disabled?

Shane