[Neo-report] r2170 gregory - /trunk/neo/storage/transactions.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jun 17 11:56:33 CEST 2010


Author: gregory
Date: Thu Jun 17 11:56:28 2010
New Revision: 2170

Log:
Clean node index of master's transaction manager.

A connection lost no more abort current transactions and clean the node
index (by calling abortFor). Do this job each time a transaction aborted
to avoid empty entries and memory leaks.

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] Thu Jun 17 11:56:28 2010
@@ -265,9 +265,14 @@ class TransactionManager(object):
                     'the lock on oid %s, but it was held by %s' % (dump(tid),
                     dump(oid), dump(lock_tid))
             del self._store_lock_dict[oid]
-        # _uuid_dict entry will be deleted at node disconnection
-        self._uuid_dict[transaction.getUUID()].discard(transaction)
+        # remove the transaction
+        uuid = transaction.getUUID()
+        self._uuid_dict[uuid].discard(transaction)
+        # clean node index if there is no more current transactions
+        if not self._uuid_dict[uuid]:
+            del self._uuid_dict[uuid]
         del self._transaction_dict[tid]
+        # some locks were released, some pending locks may now succeed
         self._app.executeQueuedEvents()
 
     def abortFor(self, uuid):





More information about the Neo-report mailing list