Commit 4d69f401 authored by Vincent Pelletier's avatar Vincent Pelletier

Maintain consistency between lock possession and object data presence.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2599 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent ed7e76f3
...@@ -104,6 +104,9 @@ class Transaction(object): ...@@ -104,6 +104,9 @@ class Transaction(object):
self._object_dict[oid] = (oid, compression, checksum, data, self._object_dict[oid] = (oid, compression, checksum, data,
value_serial) value_serial)
def delObject(self, oid):
del self._object_dict[oid]
def getObject(self, oid): def getObject(self, oid):
return self._object_dict.get(oid) return self._object_dict.get(oid)
...@@ -228,8 +231,10 @@ class TransactionManager(object): ...@@ -228,8 +231,10 @@ class TransactionManager(object):
neo.logging.info('Deadlock resolution on %r:%r', dump(oid), neo.logging.info('Deadlock resolution on %r:%r', dump(oid),
dump(tid)) dump(tid))
# A duplicate store means client is resolving a deadlock, so # A duplicate store means client is resolving a deadlock, so
# drop the lock it held on this object. # drop the lock it held on this object, and drop object data for
# consistency.
del self._store_lock_dict[oid] del self._store_lock_dict[oid]
self._transaction_dict[tid].delObject(oid)
# Give a chance to pending events to take that lock now. # Give a chance to pending events to take that lock now.
self._app.executeQueuedEvents() self._app.executeQueuedEvents()
# Attemp to acquire lock again. # Attemp to acquire lock again.
......
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