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

   ### What problem does this PR solve?
   
   Issue Number: N/A
   
   Related PR: N/A
   
   Problem Summary:
   
   `TimeSharingTaskExecutor` uses `_total_queued_tasks` for queue-size metrics 
and capacity checks. When queued splits were removed before execution, for 
example when a task was cancelled or removed, the split queue removed those 
splits but `_total_queued_tasks` was not decremented.
   
   After repeated removals, `_total_queued_tasks` could become larger than the 
real queue size. This made the executor report a non-zero queue size even when 
there were no active or queued splits, and later submissions could be rejected 
as if the queue were full.
   
   This PR keeps queue offer/remove operations consistent by updating 
`_total_queued_tasks` together with the split queue and token state.
   
   ### Release note
   
   Fix a bug where the time-sharing scan executor queue size could become 
inaccurate after queued splits were removed before execution.
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test
       - [x] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. Queued splits removed before execution now decrement executor 
queued-task accounting, so queue-size metrics and capacity checks reflect the 
real queued split count.
   
   - 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