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

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Apr 28 17:05:29 CEST 2010


Author: vincent
Date: Wed Apr 28 17:05:27 2010
New Revision: 2042

Log:
Handle answers after sending abort notifications (improving parallelism).

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] Wed Apr 28 17:05:27 2010
@@ -722,6 +722,26 @@
         if transaction is not self.local_var.txn:
             return
 
+        tid = self.local_var.tid
+        # select nodes where transaction was stored
+        cell_set = set(self._getCellListForTID(tid,
+            writable=True))
+        # select nodes where objects were stored
+        for oid in self.local_var.data_dict.iterkeys():
+            cell_set |= set(self._getCellListForOID(oid, writable=True))
+
+        p = Packets.AbortTransaction(tid)
+        # cancel transaction one all those nodes
+        for cell in cell_set:
+            conn = self.cp.getConnForCell(cell)
+            if conn is None:
+                continue
+            conn.notify(p)
+
+        # Abort the transaction in the primary master node.
+        conn = self._getMasterConnection()
+        conn.notify(p)
+
         # Just wait for responses to arrive. If any leads to an exception,
         # log it and continue: we *must* eat all answers to not disturb the
         # next transaction.
@@ -735,25 +755,6 @@
                 logging.error('Exception in tpc_abort: %s',
                     traceback.format_exc())
 
-        tid = self.local_var.tid
-        # select nodes where transaction was stored
-        cell_set = set(self._getCellListForTID(tid,
-            writable=True))
-        # select nodes where objects were stored
-        for oid in self.local_var.data_dict.iterkeys():
-            cell_set |= set(self._getCellListForOID(oid, writable=True))
-
-        p = Packets.AbortTransaction(tid)
-        # cancel transaction one all those nodes
-        for cell in cell_set:
-            conn = self.cp.getConnForCell(cell)
-            if conn is None:
-                continue
-            conn.notify(p)
-
-        # Abort the transaction in the primary master node.
-        conn = self._getMasterConnection()
-        conn.notify(p)
         self.local_var.clear()
 
     @profiler_decorator





More information about the Neo-report mailing list