[Zope-dev] more Zope2.6 fun: ZEO client death.

Anthony Baxter Anthony Baxter <anthony@interlink.com.au>
Wed, 30 Jul 2003 19:00:11 +1000


>>> Anthony Baxter wrote
> So I see ZEO clients here falling over all over the place under current
> 2.6 with:
> 
> 2003-07-30T07:01:04 ERROR(200) ZEO uncaptured python exception, 
> closing channel <ZEO.zrpc.asyncRPC connected '' at 0xc57198> 
> 
> (exceptions.AttributeError:keys 
> [/export/01/zope/dev_ekit/ZServer/medusa/asyncore.py|poll|94] 
> [/export/01/zope/dev_ekit/ZServer/medusa/asyncore.py|handle_read_event|395] 
> [/export/01/zope/dev_ekit/lib/python/ZEO/smac.py|handle_read|172] 
> [/export/01/zope/dev_ekit/lib/python/ZEO/zrpc.py|message_input|282] 
> [/export/01/zope/dev_ekit/lib/python/ZEO/ClientStorage.py|out_of_band_hook|191] 
> [/export/01/zope/dev_ekit/lib/python/ZEO/Invalidator.py|end|126] 
> [/export/01/zope/dev_ekit/lib/python/ZODB/DB.py|invalidate|318])

For what it's worth, the following patch "makes it work" for me.
RCS file: /export/00/cvsroot/Zope/lib/python/ZODB/DB.py,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 DB.py
--- DB.py       2003/07/24 08:35:40     1.1.1.11
+++ DB.py       2003/07/30 08:57:02
@@ -315,6 +315,8 @@
             version=connection._version
         # Update modified in version cache
         # XXX must make this work with list or dict to backport to 2.6
+        if type(oids) is type(''):
+            oids = { oids: 1 }
         for oid in oids.keys():
             h=hash(oid)%131
             o=self._miv_cache.get(h, None)

Note that despite the comment, it's in fact getting passed a single
oid as a string, not a dict or a list. I have no idea if there's _also_
code that might be passing a list, which will still be broken.

I'm not committing this to the CVS yet, because I'm not 100% positive 
it's the "correct" fix. It certainly _seems_ to be, and I've now got 
ZEO clients that actually work worth a damn...

Anthony