From 84edf375af41348a9d3b8626641a4c5fa4445182 Mon Sep 17 00:00:00 2001 From: Adam Crume Date: Fri, 18 Jul 2014 13:11:24 -0700 Subject: [PATCH] rbd-replay: Printing pending IOs when worker threads waiting to die Signed-off-by: Adam Crume --- src/rbd_replay/Replayer.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rbd_replay/Replayer.cc b/src/rbd_replay/Replayer.cc index 00af810c85f92..6802c95c69788 100644 --- a/src/rbd_replay/Replayer.cc +++ b/src/rbd_replay/Replayer.cc @@ -63,8 +63,16 @@ void Worker::run() { } { boost::mutex::scoped_lock lock(m_pending_ios_mutex); + bool first_time = true; while (!m_pending_ios.empty()) { - m_pending_ios_empty.wait(lock); + if (!first_time) { + dout(THREAD_LEVEL) << "Worker thread trying to stop, still waiting for " << m_pending_ios.size() << " pending IOs to complete:" << dendl; + BOOST_FOREACH(PendingIO::ptr p, m_pending_ios) { + dout(THREAD_LEVEL) << "> " << p->id() << dendl; + } + } + m_pending_ios_empty.timed_wait(lock, boost::posix_time::seconds(1)); + first_time = false; } } dout(THREAD_LEVEL) << "Worker thread stopped" << dendl; -- 2.39.5