Skip to content

Commit 26e7bbf

Browse files
committed
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 <[email protected]>
1 parent 04ae517 commit 26e7bbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/librados/aio_cxx.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,7 +2349,7 @@ void pool_io_callback(completion_t cb, void *arg /* Actually AioCompletion* */)
23492349
ASSERT_EQ(0, info->c->wait_for_complete());
23502350
}
23512351
int r = info->c->get_return_value();
2352-
cout << "finish " << i << " r = " << r << std::endl;
2352+
//cout << "finish " << i << " r = " << r << std::endl;
23532353

23542354
std::scoped_lock l(my_lock);
23552355
inflight.erase(i);
@@ -2426,8 +2426,8 @@ TEST(LibRadosAio, PoolEIOFlag) {
24262426
}
24272427

24282428
if (!missed_eio) {
2429-
GTEST_SKIP() << "eio flag missed all ios that already completed";
24302429
my_lock.unlock();
2430+
GTEST_SKIP() << "eio flag missed all ios that already completed";
24312431
}
24322432
cout << "max_success " << max_success << ", min_failed " << min_failed << std::endl;
24332433
ASSERT_TRUE(max_success + 1 == min_failed);

0 commit comments

Comments
 (0)