Skip to content

Commit

Permalink
[BugFix] Fix SenderQueue may leak closure
Browse files Browse the repository at this point in the history
the last chunks may hold the closure for rpc. direct return may cause
leak closure when _is_cancelled is true

Signed-off-by: stdpain <drfeng08@gmail.com>
  • Loading branch information
stdpain committed Nov 14, 2023
1 parent a13e3ec commit 64001a3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions be/src/runtime/sender_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,13 +766,15 @@ Status DataStreamRecvr::PipelineSenderQueue::add_chunks(const PTransmitChunkPara
// We cannot early-return for short circuit, it may occur for parts of parallelism,
// and the other parallelism may need to proceed.
}
if (_is_cancelled) {
clean_buffer_queues();
return Status::OK();
}

_recvr->_num_buffered_bytes += chunk_bytes;
COUNTER_ADD(_recvr->_peak_buffer_mem_bytes, chunk_bytes);
}

if (_is_cancelled) {
clean_buffer_queues();
return Status::OK();
}
}

return Status::OK();
Expand Down

0 comments on commit 64001a3

Please sign in to comment.