From a41bb2548d15d646433ddf27dab1eac8cd4eb9a0 Mon Sep 17 00:00:00 2001 From: Vitaly Gridnev Date: Sat, 25 Jun 2016 18:02:07 +0300 Subject: [PATCH] sleep before waiting requests to avoid issue with fast completing requests we need to sleep a little before actual waiting for requests. Closes-bug: 1596553 Change-Id: I17993f091241243eea670c7cf591ddd9c23d069c (cherry picked from commit ef00d9463524fe9e0b6935474cdd7b46fd4da1bb) --- sahara/plugins/ambari/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sahara/plugins/ambari/client.py b/sahara/plugins/ambari/client.py index f76f0d937a..b26d825d12 100644 --- a/sahara/plugins/ambari/client.py +++ b/sahara/plugins/ambari/client.py @@ -251,6 +251,7 @@ class AmbariClient(object): def wait_ambari_requests(self, requests, cluster_name): requests = set(requests) failed = [] + context.sleep(20) while len(requests) > 0: completed, not_completed = set(), set() for req_id in requests: @@ -281,6 +282,7 @@ class AmbariClient(object): LOG.debug("All ambari requests have been completed") def wait_ambari_request(self, request_id, cluster_name): + context.sleep(20) while True: status = self.check_request_status(cluster_name, request_id) LOG.debug("Task %s in %s state. Completed %.1f%%" % (