Skip to content

Commit

Permalink
[fix](move-memtable) close stream when cancel load stream stub (apach…
Browse files Browse the repository at this point in the history
…e#38912)

Fix load stream leak when sink v2 meet error.
Tested by `check_before_quit.groovy`.
  • Loading branch information
kaijchen committed Aug 7, 2024
1 parent 7e95d7c commit 607fc15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions be/src/vec/sink/load_stream_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ Status LoadStreamStub::close_wait(RuntimeState* state, int64_t timeout_ms) {

void LoadStreamStub::cancel(Status reason) {
LOG(WARNING) << *this << " is cancelled because of " << reason;
if (_is_init.load()) {
brpc::StreamClose(_stream_id);
}
{
std::lock_guard<bthread::Mutex> lock(_cancel_mutex);
_cancel_reason = reason;
Expand Down

0 comments on commit 607fc15

Please sign in to comment.