Jiří Moskovčák has uploaded a new change for review. Change subject: try harder when connecting the storage ......................................................................
try harder when connecting the storage the agent has to wait between attempts to connect the storage to give vdsm some time to initialize Change-Id: I4c512aad490366b0fbd890d156b37243993dc498 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1093621 Signed-off-by: Jiri Moskovcak <[email protected]> --- M ovirt_hosted_engine_ha/agent/hosted_engine.py 1 file changed, 9 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-ha refs/changes/24/29924/1 diff --git a/ovirt_hosted_engine_ha/agent/hosted_engine.py b/ovirt_hosted_engine_ha/agent/hosted_engine.py index 496761d..6078720 100644 --- a/ovirt_hosted_engine_ha/agent/hosted_engine.py +++ b/ovirt_hosted_engine_ha/agent/hosted_engine.py @@ -404,9 +404,7 @@ time.sleep(constants.MAX_VDSM_WAIT_SECS) self._log.debug("Verifying storage is attached") - tries = 0 - while tries < constants.MAX_VDSM_WAIT_SECS: - tries += 1 + for attempt in xrange(constants.MAX_VDSM_START_RETRIES): # `hosted-engine --connect-storage` internally calls vdsClient's # connectStorageServer command, which can be executed repeatedly # without issue even if the storage is already connected. Note @@ -417,14 +415,20 @@ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) output = p.communicate() - self._log.debug("Attempt %d, return code: %d", tries, p.returncode) + self._log.debug("Attempt %d, return code: %d", attempt, + p.returncode) self._log.debug("stdout: %s", output[0]) self._log.debug("stderr: %s", output[1]) if p.returncode == 0: self._log.debug("Successfully verified that VDSM" " is attached to storage") break - if tries == constants.MAX_VDSM_WAIT_SECS: + + self._log.warn("Failed to connect storage, waiting '{0}' seconds " + "before the next attempt" + .format(constants.MAX_VDSM_WAIT_SECS)) + time.sleep(constants.MAX_VDSM_WAIT_SECS) + else: self._log.error("Failed trying to connect storage: %s", output[1]) raise Exception("Failed trying to connect storage") -- To view, visit http://gerrit.ovirt.org/29924 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4c512aad490366b0fbd890d156b37243993dc498 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-hosted-engine-ha Gerrit-Branch: ovirt-hosted-engine-ha-1.1 Gerrit-Owner: Jiří Moskovčák <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
