[Zope-Checkins] CVS: ZODB3/ZEO - ClientStorage.py:1.85
Jeremy Hylton
jeremy@zope.com
Fri, 17 Jan 2003 12:20:35 -0500
Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv22373/ZEO
Modified Files:
ClientStorage.py
Log Message:
Change handling of tpc_abort() during disconnection.
Fix likely bug where calling tpc_abort() after a client disconnected
did not properly clear the client's internal state about the
transaction. The change means that tpc_abort() will never raise a
ClientDisconnected error, even when disconnected.
Added a new test that sort-of covers this case and deleted another
that was testing, in part, that you did get a ClientDisconnected
error.
=== ZODB3/ZEO/ClientStorage.py 1.84 => 1.85 ===
--- ZODB3/ZEO/ClientStorage.py:1.84 Wed Jan 15 13:19:15 2003
+++ ZODB3/ZEO/ClientStorage.py Fri Jan 17 12:20:03 2003
@@ -759,11 +759,19 @@
if transaction is not self._transaction:
return
try:
- self._server.tpc_abort(self._serial)
+ # XXX Are there any transactions that should prevent an
+ # abort from occurring? It seems wrong to swallow them
+ # all, yet you want to be sure that other abort logic is
+ # executed regardless.
+ try:
+ self._server.tpc_abort(self._serial)
+ except ClientDisconnected:
+ # log the error and continue
+ pass
+ finally:
self._tbuf.clear()
self._seriald.clear()
del self._serials[:]
- finally:
self.end_transaction()
def tpc_finish(self, transaction, f=None):