[Zope-dev] Infuriating ZClass registry Heisenbug

Evan Simpson evan@4-am.com
Tue, 10 Dec 2002 20:58:07 -0600


Shane Hathaway wrote:
> My first recommendation would be to turn your ZClass registry into an 
> OOBTree.  OOBTree has been maintained and updated.

Good thought, but no dice.

Since it is rebuilding the registry on every restart anyway, I went 
ahead and made the changes to my OFS/Application.py.  I confirmed that 
ZGlobals is now an OOBTree, but subsequent restarts continue to show the 
same problem :-(

I've placed pdb.set_trace all over the DB state-loading code.  When I 
attempt to step into the "state = unpickler.load()" line during the 
loading of the ZGlobals OOBTree, it immediately throws an ImportError on 
the ZClass GUID.  It doesn't even seem to enter the persistent_load or 
classLoader methods.

Tracing this has gotten me all confused.  I understand (I think) that 
when a ZClass instance is unpickled, persistent_load gets the ZClass 
GUID and uses that to look up the actual _zclass_ class in ZGlobals. 
What I can't understand is why it would try to import the GUID when 
loading ZGlobals.  All it has it in is strings and the _zclass_ 
ExtensionClasses, and they should be handled by the normal unpickling 
machinery, right?

Thanks,

Evan