]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix RGWCompletionManager get_next stuck after going down 20095/head
authorTianshan Qu <tianshan@xsky.com>
Wed, 24 Jan 2018 10:51:41 +0000 (18:51 +0800)
committerTianshan Qu <tianshan@xsky.com>
Thu, 25 Jan 2018 18:10:28 +0000 (02:10 +0800)
fix the situation cond.Signal() fist then we go into cond.wait()

fixes: http://tracker.ceph.com/issues/22799

Signed-off-by: Tianshan Qu <tianshan@xsky.com>
src/rgw/rgw_coroutine.cc

index 479805b29b6534554f1f8ed84664eea90d32d6e8..ba0ba1ecdbc79aa1ef9a95320eff7217e6363a6d 100644 (file)
@@ -68,10 +68,10 @@ int RGWCompletionManager::get_next(void **user_info)
 {
   Mutex::Locker l(lock);
   while (complete_reqs.empty()) {
-    cond.Wait(lock);
     if (going_down) {
       return -ECANCELED;
     }
+    cond.Wait(lock);
   }
   *user_info = complete_reqs.front();
   complete_reqs.pop_front();