Commit d4658bc6 authored by Vincent Pelletier's avatar Vincent Pelletier

Factorise packet creation.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2039 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 0ca4ff38
...@@ -725,6 +725,7 @@ class Application(object): ...@@ -725,6 +725,7 @@ class Application(object):
# ignore the outcome: we are going to abort anyway. # ignore the outcome: we are going to abort anyway.
self.waitResponses() self.waitResponses()
tid = self.local_var.tid
cell_set = set() cell_set = set()
# select nodes where objects were stored # select nodes where objects were stored
for oid in self.local_var.data_dict.iterkeys(): for oid in self.local_var.data_dict.iterkeys():
...@@ -733,16 +734,17 @@ class Application(object): ...@@ -733,16 +734,17 @@ class Application(object):
cell_set |= set(self._getCellListForTID(self.local_var.tid, cell_set |= set(self._getCellListForTID(self.local_var.tid,
writable=True)) writable=True))
p = Packets.AbortTransaction(tid)
# cancel transaction one all those nodes # cancel transaction one all those nodes
for cell in cell_set: for cell in cell_set:
conn = self.cp.getConnForCell(cell) conn = self.cp.getConnForCell(cell)
if conn is None: if conn is None:
continue continue
conn.notify(Packets.AbortTransaction(self.local_var.tid)) conn.notify(p)
# Abort the transaction in the primary master node. # Abort the transaction in the primary master node.
conn = self._getMasterConnection() conn = self._getMasterConnection()
conn.notify(Packets.AbortTransaction(self.local_var.tid)) conn.notify(p)
self.local_var.clear() self.local_var.clear()
@profiler_decorator @profiler_decorator
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment