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

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: None
   
   Problem Summary:
   
   When a query is cancelled, every pending pipeline task can be awakened and 
closed with the same error. `TaskScheduler::close_task()` calls 
`PipelineFragmentContext::cancel()` before incrementing the fragment 
closed-task count, so each task can repeat the fragment-wide timeout dump, 
instance logs, query cancellation, stream cancellation, and dependency 
unblocking. For a fragment with many tasks, the full task dump is therefore 
amplified roughly quadratically.
   
   This change adds an atomic one-shot gate after `notify_close()`. The first 
active cancellation retains all existing behavior; later calls return before 
fragment-level logging and side effects. Keeping `notify_close()` before the 
gate preserves recursive CTE close handling and the already-closed removal path.
   
   ### Release note
   
   Prevent repeated BE pipeline timeout dumps when a query is cancelled.
   
   ### Check List (For Author)
   
   - Test
       - [ ] Regression test
       - [x] Unit Test
           - `GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh -j 48 --run 
--filter=PipelineTaskTest.TEST_FRAGMENT_CANCEL_IS_IDEMPOTENT`
       - [ ] Manual test
       - [ ] No need to test or manual test.
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. Duplicate fragment cancellation diagnostics and side effects 
are suppressed; the first cancellation is unchanged.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label


-- 
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