]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't force wait on blocked coroutines
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 2 Sep 2015 23:21:47 +0000 (16:21 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:12:39 +0000 (16:12 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_coroutine.cc

index a92a51ccbe517247d0612b29abf9161df1d498c4..7678ff78e12e7b81505338eed064062bddbf5609 100644 (file)
@@ -265,17 +265,10 @@ int RGWCoroutinesManager::run(list<RGWCoroutinesStack *>& 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<RGWCoroutinesStack *>& stacks)
       handle_unblocked_stack(stacks, blocked_stack, &blocked_count);
       iter = stacks.begin();
     }
+
+    if (iter == stacks.end()) {
+      iter = stacks.begin();
+    }
   }
 
   return 0;