[repo] on repository shutdown, we've to close the new eid creation connection stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 15 Jun 2010 18:00:28 +0200
branchstable
changeset 5749 b4393b681f7a
parent 5748 487ab6ac90cc
child 5750 b3bc214cd479
[repo] on repository shutdown, we've to close the new eid creation connection
server/repository.py
server/sources/native.py
--- a/server/repository.py	Tue Jun 15 18:00:26 2010 +0200
+++ b/server/repository.py	Tue Jun 15 18:00:28 2010 +0200
@@ -325,6 +325,7 @@
         """
         assert not self._shutting_down, 'already shutting down'
         self._shutting_down = True
+        self.system_source.shutdown()
         if isinstance(self._looping_tasks, tuple): # if tasks have been started
             for looptask in self._looping_tasks:
                 self.info('canceling task %s...', looptask.name)
--- a/server/sources/native.py	Tue Jun 15 18:00:26 2010 +0200
+++ b/server/sources/native.py	Tue Jun 15 18:00:28 2010 +0200
@@ -335,6 +335,10 @@
     def init(self):
         self.init_creating()
 
+    def shutdown(self):
+        if self._eid_creation_cnx:
+            self._eid_creation_cnx.close()
+
     # XXX deprecates [un]map_attribute ?
     def map_attribute(self, etype, attr, cb, sourcedb=True):
         self._rql_sqlgen.attr_map['%s.%s' % (etype, attr)] = (cb, sourcedb)