From: Casey Bodley Date: Mon, 27 Feb 2017 20:19:54 +0000 (-0500) Subject: rgw: RGWBackoffControlCR only retries until success X-Git-Tag: v12.0.3~225^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a898fb76a4179add68ccb526f2917768736ac52b;p=ceph.git rgw: RGWBackoffControlCR only retries until success Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index 0aad40c23bb5..d8de8e5d2cfe 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -83,8 +83,8 @@ void RGWSyncBackoff::backoff(RGWCoroutine *op) } int RGWBackoffControlCR::operate() { - RGWCoroutine *finisher_cr; reenter(this) { + // retry the operation until it succeeds while (true) { yield { Mutex::Locker l(lock); @@ -97,7 +97,10 @@ int RGWBackoffControlCR::operate() { cr->put(); cr = NULL; } - if (retcode < 0 && retcode != -EBUSY && retcode != -EAGAIN) { + if (retcode >= 0) { + break; + } + if (retcode != -EBUSY && retcode != -EAGAIN) { ldout(cct, 0) << "ERROR: RGWBackoffControlCR called coroutine returned " << retcode << dendl; if (exit_on_error) { return set_cr_error(retcode); @@ -107,17 +110,15 @@ int RGWBackoffControlCR::operate() { backoff.reset(); } yield backoff.backoff(this); - finisher_cr = alloc_finisher_cr(); - if (finisher_cr) { - yield call(finisher_cr); - if (retcode < 0) { - ldout(cct, 0) << "ERROR: call to finisher_cr() failed: retcode=" << retcode << dendl; - if (exit_on_error) { - return set_cr_error(retcode); - } - } - } } + + // run an optional finisher + yield call(alloc_finisher_cr()); + if (retcode < 0) { + ldout(cct, 0) << "ERROR: call to finisher_cr() failed: retcode=" << retcode << dendl; + return set_cr_error(retcode); + } + return set_cr_done(); } return 0; }