]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
unittest_osdmap aborted during OSDMapTest.BUG_42485
authorMohit Agrawal <moagrawa@redhat.com>
Wed, 12 Jun 2024 11:49:18 +0000 (17:19 +0530)
committerMohit Agrawal <moagrawa@redhat.com>
Wed, 12 Jun 2024 11:49:18 +0000 (17:19 +0530)
The testcase is aborted during the call of clean_upmap_tp
thread. The function(clean_pg_upmaps) spawns a number
of worker threads to process a PGMapper job. The worker
thread fetch a job from the queue and then process the
job and call process_finish the job. The process function
of PGMapper class destroying the object and as worker thread
call _process_finish function it crashes because job pointer
has become a dangling pointer.

Solution: To avoid a crash destroy the object in  _process_finish
          instead of doing in _process.

Fixes: https://tracker.ceph.com/issues/62934
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
src/osd/OSDMapMapping.cc
src/osd/OSDMapMapping.h

index 9cd1fbf58238fb26102143eddc7cbe785c075541..bc53bddecde4ecae72b37eacc65fc6e8d5242ca2 100644 (file)
@@ -158,7 +158,6 @@ void ParallelPGMapper::WQ::_process(Item *i, ThreadPool::TPHandle &h)
   else
     i->job->process(i->pool, i->begin, i->end);
   i->job->finish_one();
-  delete i;
 }
 
 void ParallelPGMapper::queue(
index 216c30446a95a216230681f94feb73cf3f7db3bd..40193b582f613ffec99908346b66532ef475f306 100644 (file)
@@ -144,6 +144,7 @@ protected:
     }
 
     void _process(Item *i, ThreadPool::TPHandle &h) override;
+    void _process_finish(Item *i) override { delete i;}
 
     void _clear() override {
       ceph_assert(_empty());