[ZODB-Dev] zodb wants to import my module?

Tim Peters tim at zope.com
Thu Nov 11 11:04:18 EST 2004


[Chris Bainbridge]
>>> When I call get_transaction().commit() I sometimes get an ImportError
>>> from zodb:

[Tim Peters]
>> More precisely, a ZEO client is reporting an exception raised on the ZEO
>> server, when an attempt at conflict resolution on the server failed, and
>> the attempt to raise ConflictError itself failed because the server
>> wasn't able to find the name of the class of the object for which
>> conflict resolution failed.

[Christian Robottom Reis]
> Could this be made clearer in the exception we report, or is this really
> hard to fix?

I suppose it depends in part on what "this" means.  I consider Chris's
report to be a ZEO server bug, and will change things so that the ZEO server
raises the ConflictError it intended to raise.

> I've been confused in the past trying to track down if the
> exception was raised in the server or in the client, and the fact that
> it's sooo conveniently transparent is actually inconvenient here.
>
> I think this would reduce the confusion here, at least.

I have only vague understanding of some ZEO details.  I guess, but don't
know, that server-side exceptions are (re)raised on the client in this bit
of ClientStorage.py, in method _check_serials():

            for oid, s in r:
                if isinstance(s, Exception):
                    raise s
                self._seriald[oid] = s

It's probably crucial to raise the same specific exception as was raised on
the server (for example, app code may be trying to catch ConflictError
specifically, and would break if that were changed to, e.g.,
PropagatedZEOServerError).  If we can't change the exception raised, then
there's no general way to sneak new info into the message produced by a
given exception (that message is generated by the exception's __str__
method, which may be anything).



More information about the ZODB-Dev mailing list