This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 7770090235b branch-4.0: [Chore](scan) make scanner wait worker timer 
more more accurate #58833 (#58862)
7770090235b is described below

commit 7770090235b917c36e396798652149bf06cf8068
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Dec 10 09:51:42 2025 +0800

    branch-4.0: [Chore](scan) make scanner wait worker timer more more accurate 
#58833 (#58862)
    
    Cherry-picked from #58833
    
    Co-authored-by: Pxl <[email protected]>
---
 be/src/vec/exec/scan/scanner_scheduler.cpp | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/be/src/vec/exec/scan/scanner_scheduler.cpp 
b/be/src/vec/exec/scan/scanner_scheduler.cpp
index f932ea420c6..b2dc4981003 100644
--- a/be/src/vec/exec/scan/scanner_scheduler.cpp
+++ b/be/src/vec/exec/scan/scanner_scheduler.cpp
@@ -157,6 +157,17 @@ void 
ScannerScheduler::_scanner_scan(std::shared_ptr<ScannerContext> ctx,
     max_run_time_watch.start();
     scanner->update_wait_worker_timer();
     scanner->start_scan_cpu_timer();
+    Defer defer_scanner(
+            [&] { // WorkloadGroup Policy will check cputime realtime, so that 
should update the counter
+                // as soon as possible, could not update it on close.
+                if (scanner->has_prepared()) {
+                    // Counter update need prepare successfully, or it maybe 
core. For example, olap scanner
+                    // will open tablet reader during prepare, if not prepare 
successfully, tablet reader == nullptr.
+                    scanner->update_scan_cpu_timer();
+                    scanner->update_realtime_counters();
+                    scanner->start_wait_worker_timer();
+                }
+            });
     Status status = Status::OK();
     bool eos = false;
     ASSIGN_STATUS_IF_CATCH_EXCEPTION(
@@ -313,14 +324,7 @@ void 
ScannerScheduler::_scanner_scan(std::shared_ptr<ScannerContext> ctx,
         scan_task->set_status(status);
         eos = true;
     }
-    // WorkloadGroup Policy will check cputime realtime, so that should update 
the counter
-    // as soon as possible, could not update it on close.
-    if (scanner->has_prepared()) {
-        // Counter update need prepare successfully, or it maybe core. For 
example, olap scanner
-        // will open tablet reader during prepare, if not prepare 
successfully, tablet reader == nullptr.
-        scanner->update_scan_cpu_timer();
-        scanner->update_realtime_counters();
-    }
+
     if (eos) {
         scanner->mark_to_need_to_close();
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to