]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: clean up oncommit contexts in _process shutdown
authorSage Weil <sage@redhat.com>
Fri, 22 Feb 2019 17:10:48 +0000 (11:10 -0600)
committerSage Weil <sage@redhat.com>
Wed, 27 Feb 2019 16:49:50 +0000 (10:49 -0600)
If we have queued PG completions in the workqueue and have to shut down,
delete them, so that the PG refs get cleaned up.

Fixes: http://tracker.ceph.com/issues/38431
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index bfd7b3bbb1932c083d1cf76d16e89aceaa33e540..2b9830232a4eb814dcfd5587775c3a2456a39b3e 100644 (file)
@@ -10694,6 +10694,10 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb)
   if (sdata->pqueue->empty()) {
     if (osd->is_stopping()) {
       sdata->shard_lock.unlock();
+      for (auto c : oncommits) {
+       dout(10) << __func__ << " discarding in-flight oncommit " << c << dendl;
+       delete c;
+      }
       return;    // OSD shutdown, discard.
     }
     sdata->shard_lock.unlock();
@@ -10704,6 +10708,10 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb)
   OpQueueItem item = sdata->pqueue->dequeue();
   if (osd->is_stopping()) {
     sdata->shard_lock.unlock();
+    for (auto c : oncommits) {
+      dout(10) << __func__ << " discarding in-flight oncommit " << c << dendl;
+      delete c;
+    }
     return;    // OSD shutdown, discard.
   }