bobhan1 opened a new pull request, #67942: URL: https://github.com/apache/doris/pull/67942
### What problem does this PR solve? Related PR: #61036 When a cloud query is cancelled while tablet synchronization tasks are still queued, the fragment can destroy its scan local state before a task starts. The task records its scheduling delay through a raw pointer into the local state's statistics vector before locking the task execution context, causing a heap-use-after-free. Acquire the task context before accessing the statistics and retain it through the task's deferred cleanup. Keep the execution-start timestamp at the task entry so the scheduling-delay measurement retains its original endpoint. ### Release note Fix a possible BE crash when a cloud query is cancelled during tablet synchronization. ### Check List (For Author) - Validation: Clang Format 16.0.6 and `git diff --check` passed; source review confirmed the context protects statistics access and deferred cleanup. - No new tests added. BE compilation, ASAN tests, and regression tests were not run. - Behavior changed: Yes, tasks whose execution context has expired return before accessing scan statistics. - Documentation needed: 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]
