Change in vdsm[ovirt-3.6]: migration: set timeout to 10 mins

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Thu Jan 21 12:11:03 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/1188543
---
M lib/vdsm/config.py.in
M lib/vdsm/jsonrpcvdscli.py
2 files changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/52548/1

diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 297c1d5..ccc5982 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -230,6 +230,9 @@
             '"m2c" to use the m2crypto module '
             '"ssl" to use the standard python ssl module'),
 
+        ('migration_create_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 e66a14d..4bd9847 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -25,7 +25,8 @@
 from yajsonrpc import stompreactor
 from yajsonrpc import \
     JsonRpcRequest, \
-    JsonRpcNoResponseError
+    JsonRpcNoResponseError, \
+    CALL_TIMEOUT
 
 from vdsm import response
 from .config import config
@@ -44,6 +45,10 @@
 
     def __init__(self, client):
         self._client = client
+        self._timeouts = {
+            'VM.migrationCreate': config.getint(
+                'vars', 'migration_create_timeout'),
+        }
 
     def _callMethod(self, methodName, *args):
         try:
@@ -54,7 +59,9 @@
                             (methodName, args, e))
 
         req = JsonRpcRequest(method, args, reqId=str(uuid4()))
-        responses = self._client.call(req)
+        responses = self._client.call(
+            req, timeout=self._timeouts.get(
+                methodName, CALL_TIMEOUT))
         if responses:
             resp = responses[0]
         else:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c30f972af5d96541a20c168bb27a9b3536ff247
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the vdsm-patches mailing list