[ZODB-Dev] Tracking down a freeze (deadlock?)

Tim Peters tim at zope.com
Fri Mar 4 14:45:59 EST 2005


[Dieter Maurer]
> "__del__" is a standard Python feature.

Yes, although its use is discouraged in reality (independent of Zope).

> The ZODB documentation promisses minimal requirements to make Python
> classes persistent. It does *NOT* list that "__del__" must not be used.

I'm not sure which docs you have in mind, but I'm sure that indeed none of
them say this.  If we decide to disallow __del__, I'm equally unsure of
where to document it so that people would see it.

> Apparently (I am still not yet sure), a "__del__" in a persistent class
> leads to a severe failure -- a very difficult to detect deadlock.

Florent seems to believe he has such a case.  It's obviously not the case
that every __del__ method leads to deadlock (as you've noted before too).

> We have many reports of hanging Zope instances -- reports where we do not
> know the reason. Maybe, many of those are caused by "__del__"s in
> persistent classes.

Seems unlikely to me:  in a current Zope 2.7 release, the only persistent
class with a __del__ method is one I added to ZODB's test suite (to verify
that the infinite loop in the pickle cache no longer occurs).  Maybe some
popular product has this problem?  In Florent's report, the class appeared
to live in DICODMailingList.py, but the only reference Google finds to that
is in Florent's message to zodb-dev.

> That this one was explained, a Zope expert has been necessary. Think
> about the situation when this behaviour had occured with a standard Zope
> user...

Can only repeat:

    I'm certainly not opposed to "doing something" about this one.
    The reality is I can't make time for it without dropping something
    else, though, and as I judge the tradeoffs it's not more important
    than anything else.  If it's important enough to someone else to do
    the work, cool!

Anyone sufficiently motivated and able can use the Collector to record
progress:

    http://www.zope.org/Collectors/Zope/1718

For example, it would be nice to have a small, self-contained deadlocking
test case.



More information about the ZODB-Dev mailing list