[Neo-report] r2621 vincent - /trunk/neo/storage/transactions.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jan 19 15:15:23 CET 2011


Author: vincent
Date: Wed Jan 19 15:15:23 2011
New Revision: 2621

Log:
Don't silently drop locks held by other transactions.

Modified:
    trunk/neo/storage/transactions.py

Modified: trunk/neo/storage/transactions.py
==============================================================================
--- trunk/neo/storage/transactions.py [iso-8859-1] (original)
+++ trunk/neo/storage/transactions.py [iso-8859-1] Wed Jan 19 15:15:23 2011
@@ -326,12 +326,10 @@ class TransactionManager(object):
                 assert lock_ttid in (ttid, None), 'Transaction %s tried to ' \
                     'release the lock on oid %s, but it was held by %s' % (
                     dump(ttid), dump(oid), dump(lock_tid))
-            try:
-                del self._store_lock_dict[oid]
-            except KeyError:
-                # all locks might not have been acquiredwhen aborting
-                neo.lib.logging.warning('%s write lock was not held by %s',
-                    dump(oid), dump(ttid))
+            write_locking_tid = self._store_lock_dict.pop(oid)
+            assert write_locking_tid == ttid, 'Inconsistent locking state: ' \
+                'aborting %s:%s but %s has the lock.' % (dump(ttid), dump(oid),
+                    dump(write_locking_tid))
         # remove the transaction
         uuid = transaction.getUUID()
         self._uuid_dict[uuid].discard(transaction)




More information about the Neo-report mailing list