From 7a74bf9d105325c9f0a4af56cd90e1a06554b71a Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Wed, 3 Jul 2024 15:18:03 +0530 Subject: [PATCH] test: Create ParallelPGMapper object before start threadpool In the case of creating a ParallelPGMapper object after starting the threadpool the test case might crash. The test case is crash while worker thread is trying to delete a job but the object is still in the construction phase not fully constructed. Solution: To avoid a crash create the object before start a threadpool. Fixes: https://tracker.ceph.com/issues/42884 Signed-off-by: Mohit Agrawal (cherry picked from commit d17efaf388bc20f0d72bb4a9a4b17d4281779f69) --- src/test/osd/TestOSDMap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/osd/TestOSDMap.cc b/src/test/osd/TestOSDMap.cc index 5435cefb5af8e..ab2eac9a75f8d 100644 --- a/src/test/osd/TestOSDMap.cc +++ b/src/test/osd/TestOSDMap.cc @@ -202,8 +202,8 @@ public: int cpu_num = 8; int pgs_per_chunk = 256; ThreadPool tp(cct, "BUG_40104::clean_upmap_tp", "clean_upmap_tp", cpu_num); - tp.start(); ParallelPGMapper mapper(cct, &tp); + tp.start(); vector pgs_to_check; om.get_upmap_pgs(&pgs_to_check); OSDMonitor::CleanUpmapJob job(cct, om, pending_inc); -- 2.39.5