[Zope-Coders] barfage on shutdown (Zope2.6)

Anthony Baxter anthony@interlink.com.au
Tue, 29 Jul 2003 17:11:40 +1000


Whenever I shut down a 2.6 based ZEO client, I get an error
Exception exceptions.AttributeError: "Connection instance has no attribute '_incrgc'" in <method Connection.close of Connection instance at c68f64> ignored
 
Looking at it, this is because ZODB.Connection.Connection._breakcr() is
called, then ZODB.Connection.Connection.close(). The former deletes
the _incrgc instance variable.

Here's the call stack when _breakcr() is called:
lib/python/ZODB/Connection.py:136 _breakcr
lib/python/ZODB/DB.py:271 close
lib/python/App/ApplicationManager.py:345 manage_shutdown
lib/python/ZPublisher/Publish.py:39 call_object
lib/python/ZPublisher/mapply.py:88 mapply
lib/python/ZPublisher/Publish.py:98 publish
lib/python/ZPublisher/Publish.py:150 publish_module
ZServer/PubCore/ZServerPublisher.py:23 __init__

And here's the subsequent failing 'close()' call
lib/python/ZODB/Connection.py:284 close
lib/python/ZPublisher/BaseRequest.py:74 close
lib/python/ZPublisher/HTTPRequest.py:146 close
lib/python/ZPublisher/Publish.py:175 publish_module
ZServer/PubCore/ZServerPublisher.py:23 __init__

The shallow fix is to put a try/except around the self._incrgc()
call, but anything involving ZODB and the garbage collector, I 
fear, and fear greatly :)

Anthony