]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use explicit flag to cancel RGWCoroutinesManager::run() 12452/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 12 Dec 2016 21:42:15 +0000 (16:42 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 12 Dec 2016 21:42:17 +0000 (16:42 -0500)
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 <cbodley@redhat.com>
src/rgw/rgw_coroutine.cc

index 8f97eac3e78835b85c80b7d3b756d83e364b3ab5..e559fab0c05498e1168739440221e22019301806 100644 (file)
@@ -462,6 +462,7 @@ int RGWCoroutinesManager::run(list<RGWCoroutinesStack *>& 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<RGWCoroutinesStack *>& 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;
     }