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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9950501fdf [fix](profile) close eof scanner before transfer done 
(#11705)
9950501fdf is described below

commit 9950501fdf14062919e17e4870cb456c57af3d95
Author: Yongqiang YANG <98214048+dataroar...@users.noreply.github.com>
AuthorDate: Fri Aug 12 11:28:43 2022 +0800

    [fix](profile) close eof scanner before transfer done (#11705)
    
    We should close eof scanners before transfer done, otherwise,
    they are closed until scannode is closed. Because plan is closed
    after the plan is finished, so query profile would leak stats from
    scanners closed by scannode::close. e.g. SegmentTotalNum in profile
    is less.
---
 be/src/vec/exec/volap_scan_node.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/be/src/vec/exec/volap_scan_node.cpp 
b/be/src/vec/exec/volap_scan_node.cpp
index a443e85029..6d69643bb8 100644
--- a/be/src/vec/exec/volap_scan_node.cpp
+++ b/be/src/vec/exec/volap_scan_node.cpp
@@ -365,6 +365,16 @@ void VOlapScanNode::transfer_thread(RuntimeState* state) {
                 }
             } else {
                 if (_scanner_done) {
+                    // We should close eof scanners before transfer done, 
otherwise,
+                    // they are closed until scannode is closed. Because plan 
is closed
+                    // after the plan is finished, so query profile would leak 
stats from
+                    // scanners closed by scannode::close.
+                    while (!_volap_scanners.empty()) {
+                        auto scanner = _volap_scanners.front();
+                        _volap_scanners.pop_front();
+                        DCHECK(scanner->need_to_close());
+                        scanner->close(state);
+                    }
                     break;
                 }
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to