]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Handle is_stopping() by discarding item so it doesn't loop 24296/head
authorDavid Zafman <dzafman@redhat.com>
Thu, 27 Sep 2018 02:03:34 +0000 (19:03 -0700)
committerDavid Zafman <dzafman@redhat.com>
Thu, 27 Sep 2018 02:39:57 +0000 (19:39 -0700)
Fixes: http://tracker.ceph.com/issues/36105
Caused by: d7ca34e12fd9dd652fe12b5593bf2ccd4ce35b60

Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/OSD.cc

index aedbc459fa5dfacb6e7b4dc1bb2c199a20e83a03..f7089d6fc0eddcda8e359e3c838c61c5c21930e1 100644 (file)
@@ -10225,23 +10225,26 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb)
     }
   }
 
-  if (osd->is_stopping()) {
-    sdata->shard_lock.Unlock();
-    return;    // OSD shutdown, discard.
-  }
-
   list<Context *> oncommits;
   if (is_smallest_thread_index && !sdata->context_queue.empty()) {
     sdata->context_queue.swap(oncommits);
   }
 
   if (sdata->pqueue->empty()) {
+    if (osd->is_stopping()) {
+      sdata->shard_lock.Unlock();
+      return;    // OSD shutdown, discard.
+    }
     sdata->shard_lock.Unlock();
     handle_oncommits(oncommits);
     return;
   }
 
   OpQueueItem item = sdata->pqueue->dequeue();
+  if (osd->is_stopping()) {
+    sdata->shard_lock.Unlock();
+    return;    // OSD shutdown, discard.
+  }
 
   const auto token = item.get_ordering_token();
   auto r = sdata->pg_slots.emplace(token, nullptr);