diff --git a/src/collective/loop.cc b/src/collective/loop.cc index 1c384bb2814a..8e84b6a82c84 100644 --- a/src/collective/loop.cc +++ b/src/collective/loop.cc @@ -185,7 +185,8 @@ void Loop::Process() { if (!rc.OK()) { set_rc(std::move(rc)); } else { - CHECK(qcopy.empty()); + std::unique_lock lock{mu_}; + CHECK(qcopy.empty() || stop_); } } catch (std::exception const& e) { curr_exce_ = std::current_exception();