Skip to content

Commit d17efaf

Browse files
committed
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 <[email protected]>
1 parent 1272408 commit d17efaf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/osd/TestOSDMap.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ class OSDMapTest : public testing::Test,
308308
int cpu_num = 8;
309309
int pgs_per_chunk = 256;
310310
ThreadPool tp(cct, "BUG_40104::clean_upmap_tp", "clean_upmap_tp", cpu_num);
311-
tp.start();
312311
ParallelPGMapper mapper(cct, &tp);
312+
tp.start();
313313
vector<pg_t> pgs_to_check;
314314
om.get_upmap_pgs(&pgs_to_check);
315315
OSDMonitor::CleanUpmapJob job(cct, om, pending_inc);

0 commit comments

Comments
 (0)