Skip to content

Commit 2de67f0

Browse files
authored
[coll] Prevent race during error check. (dmlc#10319)
1 parent 7354955 commit 2de67f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/collective/loop.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ void Loop::Process() {
185185
if (!rc.OK()) {
186186
set_rc(std::move(rc));
187187
} else {
188-
CHECK(qcopy.empty());
188+
std::unique_lock lock{mu_};
189+
CHECK(qcopy.empty() || stop_);
189190
}
190191
} catch (std::exception const& e) {
191192
curr_exce_ = std::current_exception();

0 commit comments

Comments
 (0)