summaryrefslogtreecommitdiffstats
path: root/plugins/xenserver
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-08-09 04:48:46 +0000
committerGerrit Code Review <review@openstack.org>2012-08-09 04:48:46 +0000
commit600a3bd10d00252d13e8d35502c53db693e7253d (patch)
tree12b70c5724c93b2c058350089a7e36d10865a4e9 /plugins/xenserver
parent10a5f1ac025f89f84398be308455b72d77602cc3 (diff)
parentfbb7944851b249e473dab0b350970a4695b04315 (diff)
downloadnova-600a3bd10d00252d13e8d35502c53db693e7253d.tar.gz
nova-600a3bd10d00252d13e8d35502c53db693e7253d.tar.xz
nova-600a3bd10d00252d13e8d35502c53db693e7253d.zip
Merge "xenapi: reduce polling interval for agent"
Diffstat (limited to 'plugins/xenserver')
-rwxr-xr-xplugins/xenserver/xenapi/etc/xapi.d/plugins/agent20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent b/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent
index 07122ba88..1c6bf6610 100755
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent
@@ -204,22 +204,22 @@ def _wait_for_agent(self, request_id, arg_dict):
arg_dict["path"] = "data/guest/%s" % request_id
arg_dict["ignore_missing_path"] = True
start = time.time()
- while True:
- if time.time() - start > AGENT_TIMEOUT:
- # No response within the timeout period; bail out
- # First, delete the request record
- arg_dict["path"] = "data/host/%s" % request_id
- xenstore.delete_record(self, arg_dict)
- raise TimeoutError(_("TIMEOUT: No response from agent within"
- " %s seconds.") % AGENT_TIMEOUT)
+ while time.time() - start < AGENT_TIMEOUT:
ret = xenstore.read_record(self, arg_dict)
# Note: the response for None with be a string that includes
# double quotes.
if ret != '"None"':
# The agent responded
return ret
- else:
- time.sleep(3)
+
+ time.sleep(.5)
+
+ # No response within the timeout period; bail out
+ # First, delete the request record
+ arg_dict["path"] = "data/host/%s" % request_id
+ xenstore.delete_record(self, arg_dict)
+ raise TimeoutError(_("TIMEOUT: No response from agent within"
+ " %s seconds.") % AGENT_TIMEOUT)
if __name__ == "__main__":