Skip to content

branch-4.0: [fix](runtime) Clear query_ctx_map_delay_delete in FragmentMgr::stop() to avoid UB #60718#60728

Merged
yiguolei merged 1 commit intobranch-4.0from
auto-pick-60718-branch-4.0
Feb 14, 2026
Merged

branch-4.0: [fix](runtime) Clear query_ctx_map_delay_delete in FragmentMgr::stop() to avoid UB #60718#60728
yiguolei merged 1 commit intobranch-4.0from
auto-pick-60718-branch-4.0

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #60718

…) to avoid UB (#60718)

Related PR: #59262

Problem Summary:

During BE graceful shutdown, cancel_worker cancels running queries via
_get_all_running_queries_from_fe, so clearing
_query_ctx_map_delay_delete here won't cause RF consumer to hang.
Without this clear, QueryContext destruction in ~FragmentMgr() may
attempt to remove itself from _query_ctx_map_delay_delete while the map
is being destructed, causing undefined behavior.

stack:
```
~FragmentMgr
    ~_query_ctx_map_delay_delete
        ~QueryContext
            FragmentMgr::remove_query_context
                _query_ctx_map_delay_delete.erase() ⚠️call function of object that is being destructed
```
@github-actions github-actions bot requested a review from yiguolei as a code owner February 13, 2026 01:59
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Feb 13, 2026
@hello-stephen
Copy link
Contributor

run buildall

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.99% (19102/36051)
Line Coverage 36.15% (177818/491831)
Region Coverage 32.71% (137629/420702)
Branch Coverage 33.67% (59721/177378)

@yiguolei yiguolei merged commit dce38b5 into branch-4.0 Feb 14, 2026
26 of 29 checks passed
@github-actions github-actions bot deleted the auto-pick-60718-branch-4.0 branch February 14, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments