From 73cd8df887fb5e45f2d49275cedfeab31809ddc8 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 12 Dec 2016 16:42:15 -0500 Subject: [PATCH] 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 --- src/rgw/rgw_coroutine.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index 8f97eac3e7883..e559fab0c0549 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; } -- 2.39.5