From e81f0e933afc83c9ce92a9249836978ebf9ef18e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 21 Feb 2017 12:24:14 -0600 Subject: [PATCH] ceph_test_rados_api_misc: avoid livelock from PoolCreationRace Signed-off-by: Sage Weil --- src/test/librados/misc.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/test/librados/misc.cc b/src/test/librados/misc.cc index 202c1c3af5365..74065842829de 100644 --- a/src/test/librados/misc.cc +++ b/src/test/librados/misc.cc @@ -106,7 +106,11 @@ TEST(LibRadosMiscPool, PoolCreationRace) { rados_pool_create(cluster_a, pool2name); list cls; - while (true) { + // this should normally trigger pretty easily, but we need to bound + // the requests because if we get too many we'll get stuck by always + // sending enough messages that we hit the socket failure injection. + int max = 512; + while (max--) { char buf[100]; rados_completion_t c; rados_aio_create_completion(0, 0, 0, &c); @@ -117,6 +121,11 @@ TEST(LibRadosMiscPool, PoolCreationRace) { break; } } + while (!rados_aio_is_complete(cls.front())) { + cout << "waiting 1 sec" << std::endl; + sleep(1); + } + cout << " started " << cls.size() << " aios" << std::endl; for (auto c : cls) { cout << "waiting " << (void*)c << std::endl; -- 2.39.5