[Zope-Checkins] CVS: ZODB3/ZEO - StorageServer.py:1.98.2.2
Jeremy Hylton
jeremy at zope.com
Thu Sep 4 18:27:58 EDT 2003
Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv15266/ZEO
Modified Files:
Tag: ZODB3-3_2-branch
StorageServer.py
Log Message:
Port fast-vote-fail fix from ZODB 3.1.
=== ZODB3/ZEO/StorageServer.py 1.98.2.1 => 1.98.2.2 ===
--- ZODB3/ZEO/StorageServer.py:1.98.2.1 Wed Jun 18 13:44:44 2003
+++ ZODB3/ZEO/StorageServer.py Thu Sep 4 17:27:57 2003
@@ -82,6 +82,7 @@
self.read_only = read_only
self.locked = 0
self.verifying = 0
+ self.store_failed = 0
self.log_label = _label
self.authenticated = 0
self.auth_realm = auth_realm
@@ -367,6 +368,7 @@
self.txnlog = CommitLog()
self.tid = tid
self.status = status
+ self.store_failed = 0
self.stats.active_txns += 1
def tpc_finish(self, id):
@@ -471,12 +473,14 @@
self.storage.tpc_begin(txn, tid, status)
def _store(self, oid, serial, data, version):
+ err = None
try:
newserial = self.storage.store(oid, serial, data, version,
self.transaction)
except (SystemExit, KeyboardInterrupt):
raise
except Exception, err:
+ self.store_failed = 1
if isinstance(err, ConflictError):
self.stats.conflicts += 1
if not isinstance(err, TransactionError):
@@ -503,9 +507,15 @@
if newserial == ResolvedSerial:
self.stats.conflicts_resolved += 1
self.serials.append((oid, newserial))
+ return err is None
def _vote(self):
self.client.serialnos(self.serials)
+ # If a store call failed, then return to the client immediately.
+ # The serialnos() call will deliver an exception that will be
+ # handled by the client in its tpc_vote() method.
+ if self.store_failed:
+ return
return self.storage.tpc_vote(self.transaction)
def _abortVersion(self, src):
@@ -558,7 +568,8 @@
loads, loader = self.txnlog.get_loader()
for i in range(loads):
# load oid, serial, data, version
- self._store(*loader.load())
+ if not self._store(*loader.load()):
+ break
resp = self._thunk()
if delay is not None:
delay.reply(resp)
More information about the Zope-Checkins
mailing list