[FIX] when runing in prefork mode, empty connection pool *after* the registry preloading
authorChristophe Simonis <chs@openerp.com>
Tue, 22 Apr 2014 12:06:48 +0000 (14:06 +0200)
committerChristophe Simonis <chs@openerp.com>
Tue, 22 Apr 2014 12:06:48 +0000 (14:06 +0200)
bzr revid: chs@openerp.com-20140422120648-2np8izn19z97e4iy

openerp/service/server.py

index 9dde14c..72e130e 100644 (file)
@@ -559,8 +559,6 @@ class PreforkServer(CommonServer):
                 raise
 
     def start(self):
-        # Empty the cursor pool, we dont want them to be shared among forked workers.
-        openerp.sql_db.close_all()
         # wakeup pipe, python doesnt throw EINTR when a syscall is interrupted
         # by a signal simulating a pseudo SA_RESTART. We write to a pipe in the
         # signal handler to overcome this behaviour
@@ -609,6 +607,9 @@ class PreforkServer(CommonServer):
             self.stop()
             return rc
 
+        # Empty the cursor pool, we dont want them to be shared among forked workers.
+        openerp.sql_db.close_all()
+
         _logger.debug("Multiprocess starting")
         while 1:
             try: