HappenLee opened a new pull request, #67261:
URL: https://github.com/apache/doris/pull/67261

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #67236
   
   Problem Summary:
   
   When a query times out, every pending pipeline task can close with the same 
error and call `PipelineFragmentContext::cancel()` before the fragment task 
count is drained. Each call previously repeated fragment cancellation logs, the 
full timeout task dump, stream-pipe cancellation, and dependency wakeups, 
causing severe log amplification.
   
   This PR replaces the separate cancellation/closed flags with one atomic 
terminal lifecycle inside `PipelineFragmentContext`:
   
   - `CREATED -> CANCELLING` elects the only cancellation winner.
   - `CREATED/CANCELLING -> CLOSING -> CLOSED` makes final close one-shot and 
handles the cancel/last-task-close race.
   - `notify_close()` remains before cancellation arbitration so recursive CTE 
fragments retain their external close-notification semantics.
   - The winning cancellation publishes the `QueryContext` error before 
expensive diagnostics, so closing tasks observe the failed query status.
   
   No per-fragment cancellation reason is stored because no runtime reader 
requires it; the query-wide first error remains owned by 
`QueryContext::AtomicStatus`.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test: Unit Test
       - `GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh -j 48 --run 
--filter=PipelineTaskTest.TEST_FRAGMENT_*LIFECYCLE`
       - `PATH=/mnt/disk6/common/ldb_toolchain_toucan/bin:$PATH 
build-support/check-format.sh`
       - `build-support/check-build-hygiene.sh`
       - `CLANG_TIDY_BINARY=/mnt/disk6/common/ldb_toolchain_028/bin/clang-tidy 
build-support/run-clang-tidy.sh --base apache/master --build-dir 
be/ut_build_ASAN`
   - Behavior changed: Yes; repeated fragment cancellation diagnostics and side 
effects now run once, and cancellation after close is ignored.
   - Does this need documentation: No


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to