Previously it was incorrectly waiting for finished IOs to complete.
The finished IO would have already been cleared by the writer thread
at this point. Any remaining pending or finished IOs implies a
failure / shutdown of the NBD device.
Fixes: https://tracker.ceph.com/issues/41409?
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
{
ceph_assert(!reader_thread.is_started());
std::unique_lock l{lock};
- cond.wait(l, [this] { return io_finished.empty(); });
+ cond.wait(l, [this] { return io_pending.empty(); });
while(!io_finished.empty()) {
std::unique_ptr<IOContext> free_ctx(io_finished.front());