From 311c105c8b6f87f330601fa707751394a903acb2 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 2 Sep 2015 16:21:47 -0700 Subject: [PATCH] rgw: don't force wait on blocked coroutines Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_coroutine.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index a92a51ccbe517..7678ff78e12e7 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -265,17 +265,10 @@ int RGWCoroutinesManager::run(list& stacks) handle_unblocked_stack(stacks, blocked_stack, &blocked_count); } - if (blocked_count >= ops_window) { - int ret = completion_mgr.get_next((void **)&blocked_stack); - if (ret < 0) { - ldout(cct, 0) << "ERROR: failed to clone shard, completion_mgr.get_next() returned ret=" << ret << dendl; - } - handle_unblocked_stack(stacks, blocked_stack, &blocked_count); - } - ++iter; stacks.pop_front(); - while (iter == stacks.end() && blocked_count > 0) { + + while (stacks.empty() && blocked_count > 0) { int ret = completion_mgr.get_next((void **)&blocked_stack); if (ret < 0) { ldout(cct, 0) << "ERROR: failed to clone shard, completion_mgr.get_next() returned ret=" << ret << dendl; @@ -283,6 +276,10 @@ int RGWCoroutinesManager::run(list& stacks) handle_unblocked_stack(stacks, blocked_stack, &blocked_count); iter = stacks.begin(); } + + if (iter == stacks.end()) { + iter = stacks.begin(); + } } return 0; -- 2.39.5