Commit 38583af9 authored by Julien Muchembled's avatar Julien Muchembled

client: better exception handling in tpc_abort

parent 77132157
...@@ -654,24 +654,18 @@ class Application(ThreadedApplication): ...@@ -654,24 +654,18 @@ class Application(ThreadedApplication):
txn_context = self._txn_container.pop(transaction) txn_context = self._txn_container.pop(transaction)
if txn_context is None: if txn_context is None:
return return
ttid = txn_context['ttid'] p = Packets.AbortTransaction(txn_context['ttid'])
p = Packets.AbortTransaction(ttid) # cancel transaction on all those nodes
getConnForNode = self.cp.getConnForNode nodes = map(self.cp.getConnForNode,
# cancel transaction one all those nodes txn_context['involved_nodes'] |
nodes = txn_context['involved_nodes'] txn_context['checked_nodes'])
nodes |= txn_context['checked_nodes'] nodes.append(self.master_conn)
for node in nodes: for conn in nodes:
conn = getConnForNode(node)
if conn is None:
continue
try:
conn.notify(p)
except:
logging.exception('Exception in tpc_abort while notifying'
'storage node %r of abortion, ignoring.', conn)
conn = self.master_conn
if conn is not None: if conn is not None:
try:
conn.notify(p) conn.notify(p)
except ConnectionClosed:
pass
# We don't need to flush queue, as it won't be reused by future # We don't need to flush queue, as it won't be reused by future
# transactions (deleted on next line & indexed by transaction object # transactions (deleted on next line & indexed by transaction object
# instance). # instance).
......
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