Add cancel check in ES Scanner (#2025)

ES http scan node will wait for the completion of the scanner scan
before closing, when a query reaches the limit limit does not release
resources in a timely manner, which may cause additional invalid
resource overhead.

such as `select * from ESTable limit 10;`
This commit is contained in:
stdpain 2021-12-10 18:10:36 +08:00 committed by GitHub
parent 619cbf3991
commit bd68e1e530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -59,6 +59,7 @@ Status EsHttpScanner::get_next(RuntimeState* runtime_state, ChunkPtr* chunk, boo
}
while (!_batch_eof) {
RETURN_IF_CANCELLED(runtime_state);
if (_line_eof || _es_scroll_parser == nullptr) {
RETURN_IF_ERROR(_es_reader->get_next(&_batch_eof, _es_scroll_parser));
_es_scroll_parser->set_params(_tuple_desc, &_docvalue_context);