[ZODB-Dev] Odd DisconnectedError with ZEO (HEAD)

Christian Reis kiko at async.com.br
Mon Jul 28 16:14:04 EDT 2003


When using authentication, I'm coming across a peculiar problem with a
persistent object that holds two PersistentMappings. I'm not 100% sure
it's ties to authentication or local transactions, which we use too, but
I'll exemplify with two short runs which produce the same results
consistently:

    >>> c
    <Connection at 08251bac>
    >>> r = c.root()
    >>> registry = r['_ic_registry']
    >>> registry.catalogs
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "/usr/lib/python2.1/UserDict.py", line 7, in __repr__
        def __repr__(self): return repr(self.data)
      File
    "/usr/local/lib/Stoq//lib/python2.1/site-packages/ZODB/Connection.py",
    line 571, in setstate
        p, serial = self._storage.load(oid, self._version)
      File
    "/usr/local/lib/Stoq//lib/python2.1/site-packages/ZEO/ClientStorage.py",
    line 725, in load
        p, s, v, pv, sv = self._server.zeoLoad(oid)
      File
    "/usr/local/lib/Stoq//lib/python2.1/site-packages/ZEO/ServerStub.py",
    line 78, in zeoLoad
        return self.rpc.call('zeoLoad', oid)
      File
    "/usr/local/lib/Stoq//lib/python2.1/site-packages/ZEO/zrpc/connection.py",
    line 363, in call
        r_flags, r_args = self.wait(msgid)
      File
    "/usr/local/lib/Stoq//lib/python2.1/site-packages/ZEO/zrpc/connection.py",
    line 453, in wait
        raise DisconnectedError()
    ZEO.zrpc.error.DisconnectedError

This raises a DisconectedError, even though this is a freshly-obtained
connection from a newly-instantiated ClientStorage. However, if I
*print* dir(registry) before accessing registry.catalogs, all is fine:

    >>> c
    <Connection at 08251bac>
    >>> r = c.root()
    >>> registry = r['_ic_registry']
    >>> print dir(registry)             # a placebo?
    []
    >>> registry.catalogs
    {'domain.payment.InPayment': <Catalog:InPayment at 0x8388158>,
     # ... goes on displaying all catalogs
    }

I'm thinking I'm doing something wrong, because print shouldn't change
anything, but perhaps it's an exception problem somewhere. If remove the
print, or assign dir(registry) to a variable instead of print, I get the
DisconnectedError. Anybody have a clue as to where I to start looking?

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL



More information about the ZODB-Dev mailing list