From 9a6771a86484fa55758c6d132caeb7f97b22c822 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 4 Mar 2016 15:22:50 -0500 Subject: [PATCH] rgw: fix for RGWCoroutinesManager::run() return value the 'int ret' variable of the inner scope was shadowing an 'int ret' variable in the outer scope, so we weren't propagating any of the error codes Signed-off-by: Casey Bodley --- src/rgw/rgw_coroutine.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index ba36756501c3..cdbc9a5d8376 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -439,7 +439,7 @@ int RGWCoroutinesManager::run(list& stacks) RGWCoroutinesStack *stack = *iter; env.stack = stack; - int ret = stack->operate(&env); + ret = stack->operate(&env); stack->set_is_scheduled(false); if (ret < 0) { ldout(cct, 0) << "ERROR: stack->operate() returned ret=" << ret << dendl; @@ -532,6 +532,9 @@ int RGWCoroutinesManager::run(list& stacks) handle_unblocked_stack(context_stacks, scheduled_stacks, blocked_stack, &blocked_count); iter = scheduled_stacks.begin(); } + if (ret == -ECANCELED) { + break; + } if (iter == scheduled_stacks.end()) { iter = scheduled_stacks.begin(); -- 2.47.3