[Neo-report] r1858 vincent - /trunk/neo/client/app.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Feb 25 14:52:46 CET 2010


Author: vincent
Date: Thu Feb 25 14:52:46 2010
New Revision: 1858

Log:
Wait for all storage responses when aborting.

Aborting might happen even before vote is called, wot there might be
pending store responses. Wait for them without doing conflict handling.

Modified:
    trunk/neo/client/app.py

Modified: trunk/neo/client/app.py
==============================================================================
--- trunk/neo/client/app.py [iso-8859-1] (original)
+++ trunk/neo/client/app.py [iso-8859-1] Thu Feb 25 14:52:46 2010
@@ -634,6 +634,8 @@
             # dected as closed)
             while pending(queue):
                 _waitAnyMessage()
+            if tryToResolveConflict is None:
+                break
             conflicts = _handleConflicts(tryToResolveConflict)
             if conflicts:
                 update(conflicts)
@@ -642,15 +644,16 @@
                 # requests
                 break
 
-        # Check for never-stored objects, and update result for all others
-        for oid, store_count in \
-            local_var.object_stored_counter_dict.iteritems():
-            if store_count == 0:
-                raise NEOStorageError('tpc_store failed')
-            elif oid in resolved_oid_set:
-                append((oid, ResolvedSerial))
-            else:
-                append((oid, tid))
+        if tryToResolveConflict is not None:
+            # Check for never-stored objects, and update result for all others
+            for oid, store_count in \
+                local_var.object_stored_counter_dict.iteritems():
+                if store_count == 0:
+                    raise NEOStorageError('tpc_store failed')
+                elif oid in resolved_oid_set:
+                    append((oid, ResolvedSerial))
+                else:
+                    append((oid, tid))
         return result
 
     def tpc_vote(self, transaction, tryToResolveConflict):
@@ -699,6 +702,10 @@
         """Abort current transaction."""
         if transaction is not self.local_var.txn:
             return
+
+        # Just wait for response to arrive, don't handle any conflict, and
+        # ignore the outcome: we are going to abort anyway.
+        self.waitStoreResponses(None)
 
         cell_set = set()
         # select nodes where objects were stored





More information about the Neo-report mailing list