You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2024/01/11 08:48:27 UTC
(doris) 02/02: [bugfix](scannerdeadloop) there is a dead loop in scanner ctx (#29794)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 9ef4e49307e9543f83c3b0c68ebc3fd216a1094f
Author: yiguolei <67...@qq.com>
AuthorDate: Wed Jan 10 21:48:23 2024 +0800
[bugfix](scannerdeadloop) there is a dead loop in scanner ctx (#29794)
Co-authored-by: yiguolei <yi...@gmail.com>
---
be/src/vec/exec/scan/scanner_scheduler.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/be/src/vec/exec/scan/scanner_scheduler.cpp b/be/src/vec/exec/scan/scanner_scheduler.cpp
index 4223bd7abb0..6fd49aa9d10 100644
--- a/be/src/vec/exec/scan/scanner_scheduler.cpp
+++ b/be/src/vec/exec/scan/scanner_scheduler.cpp
@@ -213,6 +213,8 @@ void ScannerScheduler::_schedule_scanners(std::shared_ptr<ScannerContext> ctx) {
while (iter != this_run.end()) {
std::shared_ptr<ScannerDelegate> scanner_delegate = (*iter).lock();
if (scanner_delegate == nullptr) {
+ // Has to ++, or there is a dead loop
+ iter++;
continue;
}
scanner_delegate->_scanner->start_wait_worker_timer();
@@ -220,7 +222,7 @@ void ScannerScheduler::_schedule_scanners(std::shared_ptr<ScannerContext> ctx) {
this->_scanner_scan(this, ctx, scanner_ref);
});
if (s.ok()) {
- this_run.erase(iter++);
+ iter++;
} else {
ctx->set_status_on_error(s);
break;
@@ -230,6 +232,8 @@ void ScannerScheduler::_schedule_scanners(std::shared_ptr<ScannerContext> ctx) {
while (iter != this_run.end()) {
std::shared_ptr<ScannerDelegate> scanner_delegate = (*iter).lock();
if (scanner_delegate == nullptr) {
+ // Has to ++, or there is a dead loop
+ iter++;
continue;
}
scanner_delegate->_scanner->start_wait_worker_timer();
@@ -259,7 +263,7 @@ void ScannerScheduler::_schedule_scanners(std::shared_ptr<ScannerContext> ctx) {
ret = _remote_scan_thread_pool->offer(task);
}
if (ret) {
- this_run.erase(iter++);
+ iter++;
} else {
ctx->set_status_on_error(
Status::InternalError("failed to submit scanner to scanner pool"));
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org