Skip to content

Commit

Permalink
Merge pull request ceph#1033 from ceph/wip-wait-osd-timeout
Browse files Browse the repository at this point in the history
misc.wait_until_osds_up(): timeout after 5min
  • Loading branch information
dmick authored Feb 24, 2017
2 parents a29b9bf + 207cf2d commit 45a3f4e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions teuthology/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,26 +910,26 @@ def wait_until_osds_up(ctx, cluster, remote, ceph_cluster='ceph'):
"""Wait until all Ceph OSDs are booted."""
num_osds = num_instances_of_type(cluster, 'osd', ceph_cluster)
testdir = get_testdir(ctx)
while True:
r = remote.run(
args=[
'adjust-ulimits',
'ceph-coverage',
'{tdir}/archive/coverage'.format(tdir=testdir),
'ceph',
'--cluster', ceph_cluster,
'osd', 'dump', '--format=json'
],
stdout=StringIO(),
logger=log.getChild('health'),
)
out = r.stdout.getvalue()
j = json.loads('\n'.join(out.split('\n')[1:]))
up = len(filter(lambda o: 'up' in o['state'], j['osds']))
log.debug('%d of %d OSDs are up' % (up, num_osds))
if up == num_osds:
break
time.sleep(1)
with safe_while(sleep=6, tries=50) as proceed:
while proceed():
r = remote.run(
args=[
'adjust-ulimits',
'ceph-coverage',
'{tdir}/archive/coverage'.format(tdir=testdir),
'ceph',
'--cluster', ceph_cluster,
'osd', 'dump', '--format=json'
],
stdout=StringIO(),
logger=log.getChild('health'),
)
out = r.stdout.getvalue()
j = json.loads('\n'.join(out.split('\n')[1:]))
up = len(filter(lambda o: 'up' in o['state'], j['osds']))
log.debug('%d of %d OSDs are up' % (up, num_osds))
if up == num_osds:
break


def reboot(node, timeout=300, interval=30):
Expand Down

0 comments on commit 45a3f4e

Please sign in to comment.