zhiqiang-hhhh commented on code in PR #25524: URL: https://github.com/apache/doris/pull/25524#discussion_r1368456858
########## be/src/runtime/fragment_mgr.cpp: ########## @@ -979,37 +984,13 @@ void FragmentMgr::cancel_query_unlocked(const TUniqueId& query_id, return; } - if (ctx->second->enable_pipeline_exec()) { - for (auto it : ctx->second->fragment_ids) { - // instance_id will not be removed from query_context.instance_ids currently - // and it will be removed from fragment_mgr::_pipeline_map only. - // so we add this check to avoid too many WARNING log. - if (_pipeline_map.contains(it)) { - cancel_instance_unlocked(it, reason, state_lock, msg); - } - } - } else { - for (auto it : ctx->second->fragment_ids) { - cancel_fragment_unlocked(it, reason, state_lock, msg); - } + for (auto it : ctx->second->fragment_ids) { Review Comment: done ########## be/src/service/internal_service.cpp: ########## @@ -558,15 +558,19 @@ void PInternalServiceImpl::cancel_plan_fragment(google::protobuf::RpcController* tid.__set_lo(request->finst_id().lo()); signal::set_signal_task_id(tid); Status st = Status::OK(); - if (request->has_cancel_reason()) { - LOG(INFO) << "cancel fragment, fragment_instance_id=" << print_id(tid) - << ", reason: " << PPlanFragmentCancelReason_Name(request->cancel_reason()); - _exec_env->fragment_mgr()->cancel_instance(tid, request->cancel_reason()); - } else { - LOG(INFO) << "cancel fragment, fragment_instance_id=" << print_id(tid); - _exec_env->fragment_mgr()->cancel_instance(tid, - PPlanFragmentCancelReason::INTERNAL_ERROR); - } + + const bool is_pipeline_fragment = _exec_env->fragment_mgr()->is_pipeline_fragment(tid); + const bool has_cancel_reason = request->has_cancel_reason(); + LOG(INFO) << fmt::format("Cancel {}instance {}, reason: {}", + is_pipeline_fragment ? "pipeline " : "", print_id(tid), + has_cancel_reason + ? PPlanFragmentCancelReason_Name(request->cancel_reason()) + : "INTERNAL_ERROR"); + + _exec_env->fragment_mgr()->cancel_instance( Review Comment: done -- 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