From: Casey Bodley Date: Mon, 12 Dec 2016 21:42:15 +0000 (-0500) Subject: rgw: use explicit flag to cancel RGWCoroutinesManager::run() X-Git-Tag: v11.1.1~61^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F12452%2Fhead;p=ceph.git rgw: use explicit flag to cancel RGWCoroutinesManager::run() RGWCoroutinesManager::run() was setting ret = -ECANCELED to break out of the loop when it sees going_down. coroutines that failed with -ECANCELED were confusing this logic and leading to coroutine deadlock assertions below. when we hit the going_down case, set a 'canceled' flag, and check that flag when deciding whether to break out of the loop Fixes: http://tracker.ceph.com/issues/17465 Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index 8f97eac3e788..e559fab0c054 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -462,6 +462,7 @@ int RGWCoroutinesManager::run(list& stacks) int ret = 0; int blocked_count = 0; int interval_wait_count = 0; + bool canceled = false; // set on going_down RGWCoroutinesEnv env; uint64_t run_context = run_context_count.inc(); @@ -573,12 +574,13 @@ int RGWCoroutinesManager::run(list& stacks) if (going_down.read() > 0) { ldout(cct, 5) << __func__ << "(): was stopped, exiting" << dendl; ret = -ECANCELED; + canceled = true; break; } handle_unblocked_stack(context_stacks, scheduled_stacks, blocked_stack, &blocked_count); iter = scheduled_stacks.begin(); } - if (ret == -ECANCELED) { + if (canceled) { break; }