Commit 6b5e0210 authored by Vincent Pelletier's avatar Vincent Pelletier

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.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1858 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4efce397
...@@ -634,6 +634,8 @@ class Application(object): ...@@ -634,6 +634,8 @@ class Application(object):
# dected as closed) # dected as closed)
while pending(queue): while pending(queue):
_waitAnyMessage() _waitAnyMessage()
if tryToResolveConflict is None:
break
conflicts = _handleConflicts(tryToResolveConflict) conflicts = _handleConflicts(tryToResolveConflict)
if conflicts: if conflicts:
update(conflicts) update(conflicts)
...@@ -642,15 +644,16 @@ class Application(object): ...@@ -642,15 +644,16 @@ class Application(object):
# requests # requests
break break
# Check for never-stored objects, and update result for all others if tryToResolveConflict is not None:
for oid, store_count in \ # Check for never-stored objects, and update result for all others
local_var.object_stored_counter_dict.iteritems(): for oid, store_count in \
if store_count == 0: local_var.object_stored_counter_dict.iteritems():
raise NEOStorageError('tpc_store failed') if store_count == 0:
elif oid in resolved_oid_set: raise NEOStorageError('tpc_store failed')
append((oid, ResolvedSerial)) elif oid in resolved_oid_set:
else: append((oid, ResolvedSerial))
append((oid, tid)) else:
append((oid, tid))
return result return result
def tpc_vote(self, transaction, tryToResolveConflict): def tpc_vote(self, transaction, tryToResolveConflict):
...@@ -700,6 +703,10 @@ class Application(object): ...@@ -700,6 +703,10 @@ class Application(object):
if transaction is not self.local_var.txn: if transaction is not self.local_var.txn:
return 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() 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():
......
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