Change in vdsm[master]: migration: set timeout to 10 mins

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Wed Jan 13 13:11:56 UTC 2016


Piotr Kliczewski has uploaded a new change for review.

Change subject: migration: set timeout to 10 mins
......................................................................

migration: set timeout to 10 mins

On heavily loaded environments createMigration call can take a lot of
time so we want to make sure that we do not timeout prematurely.


Change-Id: I0c30f972af5d96541a20c168bb27a9b3536ff247
Signed-off-by: pkliczewski <piotr.kliczewski at gmail.com>
Bug-Url: https://bugzilla.redhat.com/188543
---
M lib/vdsm/config.py.in
M lib/vdsm/jsonrpcvdscli.py
2 files changed, 11 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/51786/1

diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index fe54318..f639fe1 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -228,6 +228,9 @@
             '"m2c" to use the m2crypto module '
             '"ssl" to use the standard python ssl module'),
 
+        ('migration_timeout', '600',
+            'Time in seconds defining how long we are going to wait for '
+            'create migration response.'),
     ]),
 
     # Section: [rpc]
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index a63437e..2eccdaf 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -87,11 +87,10 @@
         class_name, method_name = method.split('.')
         params = self._prepare_args(class_name, method_name, args, kwargs)
 
-        timeout = kwargs.pop('_transport_timeout', CALL_TIMEOUT)
-
         req = JsonRpcRequest(method, params, reqId=str(uuid4()))
 
-        responses = self._client.call(req, timeout=timeout)
+        responses = self._client.call(
+            req, timeout=self._get_call_timeout(method_name, kwargs))
         if responses:
             resp = responses[0]
         else:
@@ -110,6 +109,12 @@
 
         return response.success()
 
+    def _get_call_timeout(self, method_name, kwargs):
+        if method_name == 'migrationCreate':
+            return config.getint('vars', 'migration_timeout')
+        else:
+            return kwargs.pop('_transport_timeout', CALL_TIMEOUT)
+
     def migrationCreate(self, params):
         return self._callMethod('migrationCreate',
                                 params['vmId'],


-- 
To view, visit https://gerrit.ovirt.org/51786
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c30f972af5d96541a20c168bb27a9b3536ff247
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>


More information about the vdsm-patches mailing list