[service] make sure synchronous call_service has a cnxset stable
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 09 Apr 2013 14:23:24 +0200
branchstable
changeset 8881 ad3a1ba9ea74
parent 8880 1cad6662e199
child 8882 ee860c51f56b
[service] make sure synchronous call_service has a cnxset Fixes regression in 3.16.2 (closes #2807720)
server/repository.py
--- a/server/repository.py	Tue Apr 09 11:56:27 2013 +0200
+++ b/server/repository.py	Tue Apr 09 14:23:24 2013 +0200
@@ -898,8 +898,12 @@
             self.threaded_task(task)
         else:
             self.info('calling service %s synchronously', regid)
-            service = session.vreg['services'].select(regid, session, **kwargs)
-            return service.call(**kwargs)
+            session.set_cnxset()
+            try:
+                service = session.vreg['services'].select(regid, session, **kwargs)
+                return service.call(**kwargs)
+            finally:
+                session.free_cnxset()
 
     def user_info(self, sessionid, props=None):
         """this method should be used by client to: