]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
journal: fix race condition with unwatch on shutdown
authorJason Dillaman <dillaman@redhat.com>
Thu, 30 Jul 2015 15:39:22 +0000 (11:39 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 6 Nov 2015 01:42:42 +0000 (20:42 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/journal/JournalPlayer.cc
src/journal/ObjectPlayer.cc

index db92590b434b238e70801e2682c12b2c106dfd65..5060117c11ab9ef36f62e1340db7d919b19c0fb7 100644 (file)
@@ -115,6 +115,7 @@ void JournalPlayer::prefetch_and_watch(double interval) {
 
 void JournalPlayer::unwatch() {
   Mutex::Locker locker(m_lock);
+  m_watch_enabled = false;
   if (m_watch_scheduled) {
     ObjectPlayerPtr object_player = get_object_player();
     assert(object_player);
index ed5798198d127e3f2ca03bdcd18a150a455aecf1..939722eb31f7f7a90ef2cd8a2b8cca42a91863a4 100644 (file)
@@ -73,15 +73,12 @@ void ObjectPlayer::unwatch() {
 
   cancel_watch();
 
-  Context *ctx = m_watch_ctx;
   m_watch_ctx = NULL;
-
   m_timer_lock.Unlock();
   while (m_watch_in_progress) {
     m_watch_in_progress_cond.Wait(m_lock);
   }
   m_timer_lock.Lock();
-  delete ctx;
 }
 
 void ObjectPlayer::front(Entry *entry) const {