Skip to content

Commit

Permalink
[BugFix] Fix ASAN crash when push null chunk to accumulator (#19270)
Browse files Browse the repository at this point in the history
Signed-off-by: stdpain <[email protected]>
(cherry picked from commit 745e318)

Signed-off-by: stdpain <[email protected]>
  • Loading branch information
stdpain authored and wanpengfei-git committed Mar 10, 2023
1 parent 69a59b7 commit 67bedc9
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@ Status SortedAggregateStreamingSinkOperator::set_finishing(RuntimeState* state)
_is_finished = true;
ASSIGN_OR_RETURN(auto res, _aggregator->pull_eos_chunk());
DCHECK(_accumulator.need_input());
_accumulator.push(std::move(res));
if (res && !res->is_empty()) {
_accumulator.push(std::move(res));
}
_accumulator.finalize();
auto accumulated = std::move(_accumulator.pull());
_aggregator->offer_chunk_to_buffer(accumulated);
if (_accumulator.has_output()) {
auto accumulated = std::move(_accumulator.pull());
_aggregator->offer_chunk_to_buffer(accumulated);
}

_aggregator->set_ht_eos();
_aggregator->sink_complete();
return Status::OK();
Expand Down

0 comments on commit 67bedc9

Please sign in to comment.