yiguolei commented on code in PR #30746:
URL: https://github.com/apache/doris/pull/30746#discussion_r1477909755


##########
be/src/vec/exec/scan/scanner_context.cpp:
##########
@@ -380,168 +400,28 @@ Status ScannerContext::validate_block_schema(Block* 
block) {
     return Status::OK();
 }
 
-void ScannerContext::inc_num_running_scanners(int32_t inc) {
-    std::lock_guard l(_transfer_lock);
-    _num_running_scanners += inc;
-    g_num_running_scanners.set_value(_num_running_scanners);
-}
-
-void ScannerContext::set_status_on_error(const Status& status, bool need_lock) 
{
-    std::unique_lock l(_transfer_lock, std::defer_lock);
-    if (need_lock) {
-        l.lock();
-    }
-    if (this->status().ok()) {
-        _process_status = status;
-        _blocks_queue_added_cv.notify_one();
+void ScannerContext::stop_scanners(RuntimeState* state) {
+    std::lock_guard<std::mutex> l(_transfer_lock);
+    if (!done()) {
         _should_stop = true;
         _set_scanner_done();
-        LOG(INFO) << "ctx is set status on error " << debug_string()
-                  << ", call stack is: " << Status::InternalError<true>("catch 
error status");
-    }
-}
-
-void ScannerContext::stop_scanners(RuntimeState* state) {
-    std::unique_lock l(_transfer_lock);
-    _should_stop = true;
-    _set_scanner_done();
-    for (const std::weak_ptr<ScannerDelegate>& scanner : _all_scanners) {
-        if (std::shared_ptr<ScannerDelegate> sc = scanner.lock()) {
-            sc->_scanner->try_stop();
-        }
-    }
-    _blocks_queue.clear();
-    // TODO yiguolei, call mark close to scanners
-    if (state->enable_profile()) {

Review Comment:
   These profile is needed, we depend on this to find if there is data skew in 
scanner.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to