]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kv/leveldb: fix deadlock when close db 16643/head
authorZengran <13121369189@126.com>
Fri, 28 Jul 2017 03:25:25 +0000 (11:25 +0800)
committerZengran <13121369189@126.com>
Fri, 28 Jul 2017 03:25:25 +0000 (11:25 +0800)
because db may closed when compact_thread compacting,
so the compact_queue_cond may singaled before wait,
if we dont check the compact_queue_stop,
we deadlock after compact_queue_cond.wait()!

Signed-off-by: Zengran <13121369189@126.com>
src/kv/LevelDBStore.cc

index 25ff7a698d2e32bc56d6682d347373d687c5f731..f4fc12057f78058da012668f5d9fcc614ca0d79b 100644 (file)
@@ -357,6 +357,8 @@ void LevelDBStore::compact_thread_entry()
       compact_queue_lock.Lock();
       continue;
     }
+    if (compact_queue_stop)
+      break;
     compact_queue_cond.Wait(compact_queue_lock);
   }
   compact_queue_lock.Unlock();