Commit 6a686360 authored by Julien Muchembled's avatar Julien Muchembled

client: small optimization in _handleConflicts

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2810 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 75ea48b1
......@@ -580,7 +580,6 @@ class Application(object):
conflict_serial = max(conflict_serial_set)
serial = object_serial_dict[oid]
data = data_dict[oid]
resolved = False
if ZERO_TID in conflict_serial_set:
# Storage refused us from taking object lock, to avoid a
# possible deadlock. TID is actually used for some kind of
......@@ -610,7 +609,7 @@ class Application(object):
self._store(txn_context, store_oid, store_serial,
store_data, unlock=True)
else:
resolved = True
continue
elif data is not None:
resolved_serial_set = resolved_conflict_serial_dict.setdefault(
oid, set())
......@@ -632,22 +631,19 @@ class Application(object):
# Try to store again
self._store(txn_context, oid, conflict_serial, new_data)
append(oid)
resolved = True
continue
else:
neo.lib.logging.info('Conflict resolution failed for ' \
'%r:%r with %r', dump(oid), dump(serial),
dump(conflict_serial))
if not resolved:
# XXX: Is it really required to remove from data_dict ?
del data_dict[oid]
txn_context['data_list'].remove(oid)
if data is None:
exc = ReadConflictError(oid=oid, serials=(conflict_serial,
raise ReadConflictError(oid=oid, serials=(conflict_serial,
serial))
else:
exc = ConflictError(oid=oid, serials=(txn_context['ttid'],
raise ConflictError(oid=oid, serials=(txn_context['ttid'],
serial), data=data)
raise exc
return result
@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