From 269c1b189d55d0c342180052932649fb7b22413a Mon Sep 17 00:00:00 2001 From: HHoflittlefish777 <77738092+HHoflittlefish777@users.noreply.github.com> Date: Fri, 29 Dec 2023 09:11:24 +0800 Subject: [PATCH] [improve](vtablet_writer) check runtime state is cancel when back pressure (#29260) --- be/src/vec/sink/writer/vtablet_writer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/vec/sink/writer/vtablet_writer.cpp b/be/src/vec/sink/writer/vtablet_writer.cpp index 3093dbc5f6b632..40b1c544e237cd 100644 --- a/be/src/vec/sink/writer/vtablet_writer.cpp +++ b/be/src/vec/sink/writer/vtablet_writer.cpp @@ -478,7 +478,7 @@ Status VNodeChannel::add_block(vectorized::Block* block, const Payload* payload, // But there is still some unfinished things, we do mem limit here temporarily. // _cancelled may be set by rpc callback, and it's possible that _cancelled might be set in any of the steps below. // It's fine to do a fake add_block() and return OK, because we will check _cancelled in next add_block() or mark_close(). - while (!_cancelled && _pending_batches_num > 0 && + while (!_cancelled && !_state->is_cancelled() && _pending_batches_num > 0 && _pending_batches_bytes > _max_pending_batches_bytes) { SCOPED_RAW_TIMER(&_stat.mem_exceeded_block_ns); std::this_thread::sleep_for(std::chrono::milliseconds(10));