merge with stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 29 Apr 2013 11:43:36 +0200
changeset 8954 9d30719142bf
parent 8952 8916a71e9f11 (current diff)
parent 8953 041804bc48e9 (diff)
child 8955 8ef2d90512b5
merge with stable
__pkginfo__.py
debian/changelog
server/repository.py
--- a/debian/changelog	Mon Apr 29 11:22:21 2013 +0200
+++ b/debian/changelog	Mon Apr 29 11:43:36 2013 +0200
@@ -4,6 +4,12 @@
 
  -- Pierre-Yves David <pierre-yves.david@logilab.fr>  Mon, 29 Apr 2013 11:20:56 +0200
 
+cubicweb (3.16.4-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Pierre-Yves David <pierre-yves.david@logilab.fr>  Fri, 26 Apr 2013 18:20:42 +0200
+
 cubicweb (3.16.3-1) unstable; urgency=low
 
   * New upstream release
--- a/server/repository.py	Mon Apr 29 11:22:21 2013 +0200
+++ b/server/repository.py	Mon Apr 29 11:43:36 2013 +0200
@@ -1637,8 +1637,22 @@
         # into the pyro name server
         if self._use_pyrons():
             self.looping_task(60*10, self._ensure_pyro_ns)
+        # install hacky function to free cnxset
+        self.looping_task(60, self._cleanup_pyro)
         return daemon
 
+    def _cleanup_pyro(self):
+        """Very hacky function to cleanup session left by dead Pyro thread.
+
+        There is no clean pyro callback to detect this.
+        """
+        for session in self._sessions.values():
+            for thread, cnxset in session._threads_in_transaction.copy():
+                if not thread.isAlive():
+                    self.warning('Freeing cnxset used by dead pyro threads: %',
+                                 thread)
+                    session._free_thread_cnxset(thread, cnxset)
+
     def _ensure_pyro_ns(self):
         if not self._use_pyrons():
             return