imay commented on a change in pull request #3143: Non blocking OlapTableSink URL: https://github.com/apache/incubator-doris/pull/3143#discussion_r395951806
########## File path: be/src/exec/tablet_sink.cpp ########## @@ -877,5 +920,24 @@ int OlapTableSink::_validate_data(RuntimeState* state, RowBatch* batch, Bitmap* return filtered_rows; } +void OlapTableSink::_send_batch_process() { + SCOPED_RAW_TIMER(&_non_blocking_send_ns); + while (true) { + int running_channels_num = 0; + for (auto index_channel : _channels) { + index_channel->for_each_node_channel([&](NodeChannel* ch) { + running_channels_num += ch->try_send_and_fetch_status(); + }); + } + + if (running_channels_num == 0) { + LOG(INFO) << "all node channels are stopped(maybe finished/offending/cancelled), " + "consumer thread exit."; + return; + } + std::this_thread::yield(); Review comment: If there is no other workload, will this cause a busy-loop? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org