Commit 31ad26ac authored by Julien Muchembled's avatar Julien Muchembled

client: fix handling of unresolved conflicts on old and recent ZODB

parent 053c7d76
...@@ -637,10 +637,15 @@ class Application(object): ...@@ -637,10 +637,15 @@ class Application(object):
# A later serial has already been resolved, skip. # A later serial has already been resolved, skip.
resolved_serial_set.update(conflict_serial_set) resolved_serial_set.update(conflict_serial_set)
continue continue
# BBB: On ZODB < 3.10, tryToResolveConflict returns None
# instead of raising ConflictError.
try:
new_data = tryToResolveConflict(oid, conflict_serial, new_data = tryToResolveConflict(oid, conflict_serial,
serial, data) serial, data)
except ConflictError:
new_data = None
if new_data is not None: if new_data is not None:
logging.info('Conflict resolution succeed for ' logging.info('Conflict resolution succeeded for '
'%r:%r with %r', dump(oid), dump(serial), '%r:%r with %r', dump(oid), dump(serial),
dump(conflict_serial)) dump(conflict_serial))
# Mark this conflict as resolved # Mark this conflict as resolved
...@@ -655,7 +660,7 @@ class Application(object): ...@@ -655,7 +660,7 @@ class Application(object):
logging.info('Conflict resolution failed for ' logging.info('Conflict resolution failed for '
'%r:%r with %r', dump(oid), dump(serial), '%r:%r with %r', dump(oid), dump(serial),
dump(conflict_serial)) dump(conflict_serial))
raise ConflictError(oid=oid, serials=(txn_context['ttid'], raise ConflictError(oid=oid, serials=(conflict_serial,
serial), data=data) serial), data=data)
return result return result
......
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