]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados: use WaitInterval()'s return value instead of manual timing 20028/head
authorMohamad Gebai <mgebai@suse.com>
Mon, 4 Dec 2017 12:44:40 +0000 (07:44 -0500)
committerMohamad Gebai <mgebai@suse.com>
Thu, 18 Jan 2018 15:11:51 +0000 (16:11 +0100)
Signed-off-by: Mohamad Gebai <mgebai@suse.com>
src/librados/RadosClient.cc

index 2203126c533b7bd013d91fb9e092ee35d67d3986..17c4bfcd7a1a655ee233e4bb73d2596b56df5390 100644 (file)
@@ -550,14 +550,12 @@ int librados::RadosClient::wait_for_osdmap()
 
     if (objecter->with_osdmap(std::mem_fn(&OSDMap::get_epoch)) == 0) {
       ldout(cct, 10) << __func__ << " waiting" << dendl;
-      utime_t start = ceph_clock_now();
       while (objecter->with_osdmap(std::mem_fn(&OSDMap::get_epoch)) == 0) {
         if (timeout.is_zero()) {
           cond.Wait(lock);
         } else {
-          cond.WaitInterval(lock, timeout);
-          utime_t elapsed = ceph_clock_now() - start;
-          if (elapsed > timeout) {
+          int r = cond.WaitInterval(lock, timeout);
+          if (r == ETIMEDOUT) {
             lderr(cct) << "timed out waiting for first osdmap from monitors"
                        << dendl;
             return -ETIMEDOUT;