This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new dce38b57051 branch-4.0: [fix](runtime) Clear 
query_ctx_map_delay_delete in FragmentMgr::stop() to avoid UB #60718 (#60728)
dce38b57051 is described below

commit dce38b57051b7b625ce8a41b2c8d7a4671de8008
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Feb 14 10:55:51 2026 +0800

    branch-4.0: [fix](runtime) Clear query_ctx_map_delay_delete in 
FragmentMgr::stop() to avoid UB #60718 (#60728)
    
    Cherry-picked from #60718
    
    Co-authored-by: zclllyybb <[email protected]>
---
 be/src/runtime/fragment_mgr.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp
index 8ceb04aa909..6bf60dbdfc5 100644
--- a/be/src/runtime/fragment_mgr.cpp
+++ b/be/src/runtime/fragment_mgr.cpp
@@ -340,6 +340,10 @@ void FragmentMgr::stop() {
     _thread_pool->shutdown();
     // Only me can delete
     _query_ctx_map.clear();
+    // in one BE's graceful shutdown, cancel_worker will get related running 
queries via _get_all_running_queries_from_fe and cancel them.
+    // so clearing here will not make RF consumer hang. if we dont do this, in 
~FragmentMgr() there may be QueryContext in _query_ctx_map_delay_delete
+    // destructred and remove it from _query_ctx_map_delay_delete which is 
destructring. it's UB.
+    _query_ctx_map_delay_delete.clear();
     _pipeline_map.clear();
 }
 


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

Reply via email to