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 2026/05/07 07:06:00 UTC
(doris) branch branch-4.0 updated: [Bug](profile) move watcher.stop() into locked code block (#62683)
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 a1418adf644 [Bug](profile) move watcher.stop() into locked code block (#62683)
a1418adf644 is described below
commit a1418adf64453779097342ce97acd61fb502d61e
Author: Pxl <xl...@selectdb.com>
AuthorDate: Thu May 7 15:05:51 2026 +0800
[Bug](profile) move watcher.stop() into locked code block (#62683)
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #56462
Problem Summary:
Backport of #56462 to this branch.
`Dependency::set_ready()` previously called `_watcher.stop()` outside
`_task_lock`. A concurrent `is_blocked_by()` (which acquires
`_task_lock`, checks `_ready`, and calls `start_watcher()`) could
re-start the watcher right after `stop()` but before `_ready = true` was
published; nothing stops it again. As a result `watcher_elapse_time()`
accumulates wall-clock time from the first block until the operator
closes, making `WaitForDependency` / `WaitForRuntimeFilter` profile
counters appear hugely inflated (e.g. ~12s on a 20s query while each
individual RF `WaitTime` is only tens of ms).
Move `_watcher.stop()` inside the `_task_lock` block, before setting
`_ready = true`, matching the master fix.
### Release note
None
### Check List (For Author)
- Test:
- No need to test (profile-only fix; identical to merged master change
#56462)
- Behavior changed: No
- Does this need documentation: No
Co-authored-by: Copilot <22...@users.noreply.github.com>
---
be/src/pipeline/dependency.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/be/src/pipeline/dependency.cpp b/be/src/pipeline/dependency.cpp
index 3d60720fd95..3062116e363 100644
--- a/be/src/pipeline/dependency.cpp
+++ b/be/src/pipeline/dependency.cpp
@@ -72,13 +72,13 @@ void Dependency::set_ready() {
if (_ready) {
return;
}
- _watcher.stop();
std::vector<std::weak_ptr<PipelineTask>> local_block_task {};
{
std::unique_lock<std::mutex> lc(_task_lock);
if (_ready) {
return;
}
+ _watcher.stop();
_ready = true;
local_block_task.swap(_blocked_task);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org