yiguolei commented on code in PR #32346:
URL: https://github.com/apache/doris/pull/32346#discussion_r1527691537


##########
be/src/runtime/fragment_mgr.cpp:
##########
@@ -1044,12 +1033,18 @@ void FragmentMgr::cancel_fragment_unlocked(const 
TUniqueId& query_id, int32_t fr
                                            const PPlanFragmentCancelReason& 
reason,
                                            const std::unique_lock<std::mutex>& 
state_lock,
                                            const std::string& msg) {
-    auto q_ctx = _query_ctx_map.find(query_id)->second;
-    auto f_context = q_ctx->fragment_id_to_pipeline_ctx.find(fragment_id);
-    if (f_context != q_ctx->fragment_id_to_pipeline_ctx.end()) {
-        f_context->second->cancel(reason, msg);
+    if (auto q_ctx = _query_ctx_map.find(query_id)->second) {
+        auto f_context = q_ctx->fragment_id_to_pipeline_ctx.find(fragment_id);
+        if (f_context != q_ctx->fragment_id_to_pipeline_ctx.end()) {

Review Comment:
   Add a new method in query context , not use the structure 
fragment_id_to_pipeline_ctx directly. We could not ensure the concurrency logic 
for the structure.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to