def _create_check_retry(self, **kwargs):
"""
Check the mon service is started and responding with time out.
On heavily overloaded hardware it can takes a while for the mon service
to start
"""
# Number of seconds before a time out.
timeout = 60
time_start = time.clock()
time_end = time_start + timeout
if self._create_check_responding(**kwargs):
return True
while time.clock() < time_end:
log.info("Mon service did not start up, waiting.")
time.sleep(5)
log.info("Retrying mon service.")
if self._create_check_responding(**kwargs):
return True
log.error("Timed out starting mon service")
raise Error("Failed to get mon service status after '%s' seconds." % (timeout))
评论列表
文章目录