From 5588a70c75a033b35cd4c2d88ae036ab350913a7 Mon Sep 17 00:00:00 2001 From: Nitzan Mordechai Date: Sun, 22 Jun 2025 13:43:55 +0000 Subject: [PATCH] test/librados/aio_cxx: Fix potential mutex destruction failure on PoolEIOFlag GTEST_SKIP() does not return and causes early test exit, which skips any following cleanup logic. In this case, the test skipped before releasing my_lock, causing pthread_mutex_destroy() to fail with EBUSY and trigger a ceph_assert() in the mutex debug wrapper. Fix by explicitly unlocking the mutex before calling GTEST_SKIP(). Signed-off-by: Nitzan Mordechai (cherry picked from commit 26e7bbf68142419d9e2991099e42853c1a7339b4) --- src/test/librados/aio_cxx.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/librados/aio_cxx.cc b/src/test/librados/aio_cxx.cc index b0b7b6c4e7d..32470489373 100644 --- a/src/test/librados/aio_cxx.cc +++ b/src/test/librados/aio_cxx.cc @@ -2349,7 +2349,7 @@ void pool_io_callback(completion_t cb, void *arg /* Actually AioCompletion* */) ASSERT_EQ(0, info->c->wait_for_complete()); } int r = info->c->get_return_value(); - cout << "finish " << i << " r = " << r << std::endl; + //cout << "finish " << i << " r = " << r << std::endl; std::scoped_lock l(my_lock); inflight.erase(i); @@ -2426,8 +2426,8 @@ TEST(LibRadosAio, PoolEIOFlag) { } if (!missed_eio) { - GTEST_SKIP() << "eio flag missed all ios that already completed"; my_lock.unlock(); + GTEST_SKIP() << "eio flag missed all ios that already completed"; } cout << "max_success " << max_success << ", min_failed " << min_failed << std::endl; ASSERT_TRUE(max_success + 1 == min_failed); -- 2.39.5