From: Alfredo Deza Date: Wed, 2 Nov 2016 16:19:10 +0000 (-0400) Subject: ceph-create-keys: wait for quorum for ten minutes, not forever X-Git-Tag: v10.2.6~30^2~10^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9e4455670c5adb05abbb13ca61dfe6c9d1934eba;p=ceph.git ceph-create-keys: wait for quorum for ten minutes, not forever Signed-off-by: Alfredo Deza (cherry picked from commit 32cedd2c18e48d5f9a1547e5fd69c24c7eac1638) --- diff --git a/src/ceph-create-keys b/src/ceph-create-keys index 8031b2fb257c..78525c634be5 100755 --- a/src/ceph-create-keys +++ b/src/ceph-create-keys @@ -30,7 +30,8 @@ def get_ceph_gid(): return gid def wait_for_quorum(cluster, mon_id): - while True: + wait_count = 600 # 10 minutes + while wait_count > 0: p = subprocess.Popen( args=[ 'ceph', @@ -48,11 +49,13 @@ def wait_for_quorum(cluster, mon_id): if returncode != 0: LOG.info('ceph-mon admin socket not ready yet.') time.sleep(1) + wait_count -= 1 continue if out == '': LOG.info('ceph-mon admin socket returned no data') time.sleep(1) + wait_count -= 1 continue try: @@ -65,10 +68,14 @@ def wait_for_quorum(cluster, mon_id): if state not in QUORUM_STATES: LOG.info('ceph-mon is not in quorum: %r', state) time.sleep(1) + wait_count -= 1 continue break + if wait_count == 0: + LOG.error("ceph-mon was not able to join quorum within ten minutes") + def get_key(cluster, mon_id): path = '/etc/ceph/{cluster}.client.admin.keyring'.format(