Commit 8a3369c4 authored by Vincent Pelletier's avatar Vincent Pelletier

Don't silently drop locks held by other transactions.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2621 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 26dac5fa
...@@ -326,12 +326,10 @@ class TransactionManager(object): ...@@ -326,12 +326,10 @@ class TransactionManager(object):
assert lock_ttid in (ttid, None), 'Transaction %s tried to ' \ assert lock_ttid in (ttid, None), 'Transaction %s tried to ' \
'release the lock on oid %s, but it was held by %s' % ( 'release the lock on oid %s, but it was held by %s' % (
dump(ttid), dump(oid), dump(lock_tid)) dump(ttid), dump(oid), dump(lock_tid))
try: write_locking_tid = self._store_lock_dict.pop(oid)
del self._store_lock_dict[oid] assert write_locking_tid == ttid, 'Inconsistent locking state: ' \
except KeyError: 'aborting %s:%s but %s has the lock.' % (dump(ttid), dump(oid),
# all locks might not have been acquiredwhen aborting dump(write_locking_tid))
neo.lib.logging.warning('%s write lock was not held by %s',
dump(oid), dump(ttid))
# remove the transaction # remove the transaction
uuid = transaction.getUUID() uuid = transaction.getUUID()
self._uuid_dict[uuid].discard(transaction) self._uuid_dict[uuid].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