Skip to content

Commit

Permalink
[improve](vtablet_writer) check runtime state is cancel when back pre…
Browse files Browse the repository at this point in the history
…ssure (#29260)
  • Loading branch information
sollhui authored Dec 29, 2023
1 parent 2f29dda commit 269c1b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion be/src/vec/sink/writer/vtablet_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 269c1b1

Please sign in to comment.