From: Tongliang Deng Date: Thu, 16 Jun 2022 03:46:30 +0000 (+0000) Subject: rgwlc: fix backoff sleep_ms always 0 X-Git-Tag: v18.0.0~438^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=377955f35df03eb6c8bc589118109a4466b146cd;p=ceph.git rgwlc: fix backoff sleep_ms always 0 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 --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index da2bd841e583..85d3da663ea1 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -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; }