You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2020/12/15 01:33:50 UTC

[incubator-doris] branch master updated: [Bug] Fix a core dump of counter in BE (#5078)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 81c7c03  [Bug] Fix a core dump of counter in BE (#5078)
81c7c03 is described below

commit 81c7c0360e61a6ad5ab4221f3a687d031f548e50
Author: Mingyu Chen <mo...@gmail.com>
AuthorDate: Tue Dec 15 09:33:38 2020 +0800

    [Bug] Fix a core dump of counter in BE (#5078)
    
    Introduced by PR #5051.
    As @liutang123 said, when PlanFragmentExecutor is destructed, it will call
    `close -> ExecNode::close -> OlapScanNode::close`. OlapScanNode will wait for `_transfer_thread`.
    `_transfer_thread` will wait for all OlapScanner processing to complete.
    OlapScanner is processed by the scanner thread. When the last scanner processing is completed,
    `_transfer_thread` will break out of the loop, and PlanFragmentExecutor will continue to destruct.
    And if it is completed, its RuntimeProfile::Counter will also be destructed.
    At this time, the ScopedTimer in the Scan thread may still use this Counter when it is destructed.
    
    So we must make sure that the timer is deconstructed before deconstructing the runtime profile.
---
 be/src/exec/olap_scan_node.cpp | 1 -
 be/src/exec/olap_scanner.cpp   | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/be/src/exec/olap_scan_node.cpp b/be/src/exec/olap_scan_node.cpp
index 445f88c..2097867 100644
--- a/be/src/exec/olap_scan_node.cpp
+++ b/be/src/exec/olap_scan_node.cpp
@@ -1256,7 +1256,6 @@ void OlapScanNode::transfer_thread(RuntimeState* state) {
 }
 
 void OlapScanNode::scanner_thread(OlapScanner* scanner) {
-    SCOPED_CPU_TIMER(_scan_cpu_timer);
     Status status = Status::OK();
     bool eos = false;
     RuntimeState* state = scanner->runtime_state();
diff --git a/be/src/exec/olap_scanner.cpp b/be/src/exec/olap_scanner.cpp
index 0007f85..5a959e5 100644
--- a/be/src/exec/olap_scanner.cpp
+++ b/be/src/exec/olap_scanner.cpp
@@ -257,6 +257,7 @@ Status OlapScanner::get_batch(RuntimeState* state, RowBatch* batch, bool* eof) {
     int64_t raw_rows_threshold = raw_rows_read() + config::doris_scanner_row_num;
     {
         SCOPED_TIMER(_parent->_scan_timer);
+        SCOPED_TIMER(_parent->_scan_cpu_timer);
         while (true) {
             // Batch is full, break
             if (batch->is_full()) {


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