Skip to content

Commit

Permalink
fix concurrent issue when closing load stream
Browse files Browse the repository at this point in the history
  • Loading branch information
kaijchen committed Aug 7, 2023
1 parent 831cbfd commit 5682f16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion be/src/runtime/load_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ Status LoadStream::close(uint32_t sender_id, std::vector<int64_t>* success_table
return Status::Error<ErrorCode::INVALID_ARGUMENT>("unknown sender_id {}", sender_id);
}

std::lock_guard lock_guard(_lock);

// we do nothing until recv CLOSE_LOAD from all stream to ensure all data are handled before ack
if ((++_senders_closed_streams[sender_id]) < _num_stream_per_sender) {
LOG(INFO) << fmt::format("OOXXOO {} out of {} stream received CLOSE_LOAD from sender {}",
Expand All @@ -226,7 +228,6 @@ Status LoadStream::close(uint32_t sender_id, std::vector<int64_t>* success_table
return Status::OK();
}

std::lock_guard lock_guard(_lock);
if (!_senders_status[sender_id]) {
return Status::OK();
}
Expand Down

0 comments on commit 5682f16

Please sign in to comment.