Skip to content

Commit

Permalink
[BugFix] Fix load query_mem_tracker leak (StarRocks#54242)
Browse files Browse the repository at this point in the history
Signed-off-by: meegoo <[email protected]>
  • Loading branch information
meegoo authored and magzhu committed Jan 6, 2025
1 parent f6ae211 commit d3c9880
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion be/src/exec/tablet_sink_index_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,14 @@ Status NodeChannel::_send_request(bool eos, bool finished) {
AddMultiChunkReq add_chunk = std::move(_request_queue.front());
_request_queue.pop_front();

auto request = add_chunk.second;
auto chunk = std::move(add_chunk.first);

// reset mem tracker since we don't want to send the brpc request under query_mem_tracker
// and the memory usage of the request is recorded by the olap_sink's mem tracker
SCOPED_THREAD_LOCAL_MEM_TRACKER_SETTER(nullptr);

auto request = add_chunk.second;

_mem_tracker->release(chunk->memory_usage());

RETURN_IF_ERROR(_wait_one_prev_request());
Expand Down

0 comments on commit d3c9880

Please sign in to comment.