Commit 2bd827fa authored by Julien Muchembled's avatar Julien Muchembled

client: fix abort for storages where only current serials were checked

This fixes a lock leak on storages, causing further transactions to timeout.
parent 35491a4a
...@@ -86,6 +86,7 @@ class TransactionContainer(dict): ...@@ -86,6 +86,7 @@ class TransactionContainer(dict):
'conflict_serial_dict': {}, 'conflict_serial_dict': {},
'resolved_conflict_serial_dict': {}, 'resolved_conflict_serial_dict': {},
'involved_nodes': set(), 'involved_nodes': set(),
'checked_nodes': set(),
} }
return context return context
...@@ -663,7 +664,9 @@ class Application(ThreadedApplication): ...@@ -663,7 +664,9 @@ class Application(ThreadedApplication):
p = Packets.AbortTransaction(ttid) p = Packets.AbortTransaction(ttid)
getConnForNode = self.cp.getConnForNode getConnForNode = self.cp.getConnForNode
# cancel transaction one all those nodes # cancel transaction one all those nodes
for node in txn_context['involved_nodes']: nodes = txn_context['involved_nodes']
nodes |= txn_context['checked_nodes']
for node in nodes:
conn = getConnForNode(node) conn = getConnForNode(node)
if conn is None: if conn is None:
continue continue
...@@ -995,11 +998,15 @@ class Application(ThreadedApplication): ...@@ -995,11 +998,15 @@ class Application(ThreadedApplication):
# after stores, and skips oids that have been succeessfully stored. # after stores, and skips oids that have been succeessfully stored.
assert oid not in txn_context['cache_dict'], (oid, txn_context) assert oid not in txn_context['cache_dict'], (oid, txn_context)
txn_context['data_dict'].setdefault(oid, CHECKED_SERIAL) txn_context['data_dict'].setdefault(oid, CHECKED_SERIAL)
checked_nodes = txn_context['checked_nodes']
packet = Packets.AskCheckCurrentSerial(ttid, serial, oid) packet = Packets.AskCheckCurrentSerial(ttid, serial, oid)
for node, conn in self.cp.iterateForObject(oid): for node, conn in self.cp.iterateForObject(oid):
try: try:
conn.ask(packet, queue=queue) conn.ask(packet, queue=queue)
except ConnectionClosed: except ConnectionClosed:
continue continue
checked_nodes.add(node)
if not checked_nodes:
raise NEOStorageError("checkCurrent failed")
self._waitAnyTransactionMessage(txn_context, False) self._waitAnyTransactionMessage(txn_context, False)
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