Skip to content

Commit

Permalink
[fix](move-memtable) close stream when cancel load stream stub (#38912)
Browse files Browse the repository at this point in the history
Fix load stream leak when sink v2 meet error.
Tested by `check_before_quit.groovy`.
  • Loading branch information
kaijchen authored Aug 6, 2024
1 parent 1f2f74d commit e8d342d
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 @@ -339,6 +339,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 e8d342d

Please sign in to comment.