typo, no error if thread isn't in running set stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 08 Jul 2009 07:44:41 +0200
branchstable
changeset 2319 654decb099e3
parent 2315 a1849f3ef4af
child 2320 17dc9661af57
typo, no error if thread isn't in running set
server/session.py
--- a/server/session.py	Tue Jul 07 14:29:09 2009 +0200
+++ b/server/session.py	Wed Jul 08 07:44:41 2009 +0200
@@ -146,13 +146,16 @@
         return self._threaddata.pool
 
     def reset_pool(self):
-        """the session has no longer using its pool, at least for some time"""
+        """the session is no longer using its pool, at least for some time"""
         # pool may be none if no operation has been done since last commit
         # or rollback
         if self.pool is not None and self.mode == 'read':
             # even in read mode, we must release the current transaction
             pool = self.pool
-            self._threads_in_transaction.remove(threading.currentThread())
+            try:
+                self._threads_in_transaction.remove(threading.currentThread())
+            except KeyError:
+                pass
             pool.pool_reset()
             self._threaddata.pool = None
             # free pool once everything is done to avoid race-condition