]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgwlc: fix backoff sleep_ms always 0 46711/head
authorTongliang Deng <dengtongliang@gmail.com>
Thu, 16 Jun 2022 03:46:30 +0000 (03:46 +0000)
committerTongliang Deng <dengtongliang@gmail.com>
Tue, 28 Jun 2022 12:02:38 +0000 (12:02 +0000)
SimpleBackoff from c069eb7ff09b52003fa00a5cc83b1e52370032f5 has
`sleep_ms` which is wrongly set to 0 after the first iteration.
Fix it with first retry as no-op sleep call.

Signed-off-by: Tongliang Deng <dengtongliang@gmail.com>
src/rgw/rgw_lc.cc

index da2bd841e58320771923d8d4097b80de7681db9e..85d3da663ea1673befabe45f043ee6ac16609669 100644 (file)
@@ -1671,9 +1671,7 @@ public:
       if (r) {
        return r;
       }
-      std::this_thread::sleep_for(sleep_ms);
-      sleep_ms = std::chrono::milliseconds(sleep_ms*2*retries);
-      ++retries;
+      std::this_thread::sleep_for(sleep_ms * 2 * retries++);
     }
     return false;
   }