Commit 7031a421 authored by Vincent Pelletier's avatar Vincent Pelletier

Add an assertion on tid who took the oid lock when releasing it.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1688 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 98eb9f62
...@@ -206,8 +206,10 @@ class TransactionManager(object): ...@@ -206,8 +206,10 @@ class TransactionManager(object):
# unlock any object # unlock any object
for oid in transaction.getOIDList(): for oid in transaction.getOIDList():
if has_load_lock: if has_load_lock:
# XXX: we release locks without checking if tid owns them lock_tid = self._load_lock_dict.pop(oid)
del self._load_lock_dict[oid] assert lock_tid == tid, 'Transaction %s tried to release ' \
'the lock on oid %s, but it was held by %s' % (dump(tid),
dump(oid), dump(lock_tid))
del self._store_lock_dict[oid] del self._store_lock_dict[oid]
# _uuid_dict entry will be deleted at node disconnection # _uuid_dict entry will be deleted at node disconnection
self._uuid_dict[transaction.getUUID()].discard(transaction) self._uuid_dict[transaction.getUUID()].discard(transaction)
......
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