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


##########
be/src/runtime/fragment_mgr.cpp:
##########
@@ -657,8 +662,7 @@ Status FragmentMgr::_get_query_ctx(const Params& params, 
TUniqueId query_id, boo
     } else {
         // Find _query_ctx_map, in case some other request has already
         // create the query fragments context.
-        std::lock_guard<std::mutex> lock(_lock);
-        if (auto q_ctx = _get_or_erase_query_ctx(query_id)) {
+        if (auto q_ctx = get_query_ctx(query_id)) {

Review Comment:
   在并发的时候,665行,并行多个get query ctx,得到的qctx == nullptr,然后都会运行底下创建和初始化query 
ctx的逻辑。但是最终只有一个会加入到query ctx map 中,其他的就会自动析构。 但是我们再query ctx的析构函数里做了一些操作。 例如:   
 
_exec_env->runtime_query_statistics_mgr()->set_query_finished(print_id(_query_id));
   
   这些操作,都是跟query id 绑定的,此时会出现错误。



-- 
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