From: xie xingguo Date: Mon, 23 May 2016 06:26:41 +0000 (+0800) Subject: mon: MonClient may hang on pinging monitor forever X-Git-Tag: ses5-milestone5~207^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eec849101f0cb74e42565f358733d8e3d24f0717;p=ceph.git mon: MonClient may hang on pinging monitor forever On timedout, WaitUntil() method return a positive ETIMEDOUT error number. It never returns -ETIMEDOUT. Signed-off-by: xie xingguo --- diff --git a/src/mon/MonClient.h b/src/mon/MonClient.h index 4e08ceb6d6c..ec7f688e585 100644 --- a/src/mon/MonClient.h +++ b/src/mon/MonClient.h @@ -72,7 +72,7 @@ struct MonClientPinger : public Dispatcher { int ret = 0; while (!done) { ret = ping_recvd_cond.WaitUntil(lock, until); - if (ret == -ETIMEDOUT) + if (ret == ETIMEDOUT) break; } return ret; diff --git a/src/test/pybind/test_rados.py b/src/test/pybind/test_rados.py index 03cf2dd7a14..d36c92196af 100644 --- a/src/test/pybind/test_rados.py +++ b/src/test/pybind/test_rados.py @@ -143,8 +143,10 @@ class TestRados(object): cmd = {'prefix': 'mon dump', 'format':'json'} ret, buf, out = self.rados.mon_command(json.dumps(cmd), b'') for mon in json.loads(buf.decode('utf8'))['mons']: - buf = json.loads(self.rados.ping_monitor(mon['name'])) - assert buf.get('health') + while True: + buf = json.loads(self.rados.ping_monitor(mon['name'])) + if buf.get('health'): + break def test_create(self): self.rados.create_pool('foo')