This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push: new f3a26b0e752 [Chore](log) do not print stack when stream load catch failed status on thrift (#26265) f3a26b0e752 is described below commit f3a26b0e7525813cd5286c96adb85aedf149f577 Author: Pxl <pxl...@qq.com> AuthorDate: Thu Nov 2 14:17:36 2023 +0800 [Chore](log) do not print stack when stream load catch failed status on thrift (#26265) * do not print stack when stream load catch failed status on thrift (#26062) * [Chore](status) adjust some error status print log (#24660) --- be/src/common/status.cpp | 2 +- be/src/common/status.h | 12 ++++++++---- be/src/runtime/fragment_mgr.cpp | 21 +++++++++++---------- be/src/runtime/stream_load/stream_load_executor.cpp | 2 +- be/src/service/backend_service.cpp | 4 +--- .../java/org/apache/doris/qe/QeProcessorImpl.java | 2 +- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/be/src/common/status.cpp b/be/src/common/status.cpp index ec76755fce3..bc8ed22a235 100644 --- a/be/src/common/status.cpp +++ b/be/src/common/status.cpp @@ -39,7 +39,7 @@ TStatus Status::to_thrift() const { void Status::to_protobuf(PStatus* s) const { s->clear_error_msgs(); s->set_status_code((int)_code); - if (!ok() && _err_msg) { + if (!ok()) { s->add_error_msgs(fmt::format("({})[{}]{}", BackendOptions::get_localhost(), code_as_string(), _err_msg ? _err_msg->_msg : "")); } diff --git a/be/src/common/status.h b/be/src/common/status.h index ef7513b2e8a..95bbc77a4db 100644 --- a/be/src/common/status.h +++ b/be/src/common/status.h @@ -355,14 +355,18 @@ public: return *this; } + template <bool stacktrace = true> Status static create(const TStatus& status) { - return Error<true>(status.status_code, - status.error_msgs.empty() ? "" : status.error_msgs[0]); + return Error<stacktrace>( + status.status_code, + "TStatus: " + (status.error_msgs.empty() ? "" : status.error_msgs[0])); } + template <bool stacktrace = true> Status static create(const PStatus& pstatus) { - return Error<true>(pstatus.status_code(), - pstatus.error_msgs_size() == 0 ? "" : pstatus.error_msgs(0)); + return Error<stacktrace>( + pstatus.status_code(), + "PStatus: " + (pstatus.error_msgs_size() == 0 ? "" : pstatus.error_msgs(0))); } template <int code, bool stacktrace = true, typename... Args> diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp index 9f38e91ff15..37588f36616 100644 --- a/be/src/runtime/fragment_mgr.cpp +++ b/be/src/runtime/fragment_mgr.cpp @@ -377,11 +377,12 @@ void FragmentMgr::coordinator_callback(const ReportStatusRequest& req) { FrontendServiceConnection coord(_exec_env->frontend_client_cache(), req.coord_addr, &coord_status); if (!coord_status.ok()) { - std::stringstream ss; UniqueId uid(req.query_id.hi, req.query_id.lo); - ss << "couldn't get a client for " << req.coord_addr << ", reason: " << coord_status; - LOG(WARNING) << "query_id: " << uid << ", " << ss.str(); - req.update_fn(Status::InternalError(ss.str())); + std::stringstream ss; + req.coord_addr.printTo(ss); + req.update_fn( + Status::InternalError("query_id: {}, couldn't get a client for {}, reason is {}", + uid.to_string(), ss.str(), coord_status.to_string())); return; } @@ -501,12 +502,12 @@ void FragmentMgr::coordinator_callback(const ReportStatusRequest& req) { coord->reportExecStatus(res, params); } - rpc_status = Status(Status::create(res.status)); + rpc_status = Status::create<false>(res.status); } catch (TException& e) { - std::stringstream msg; - msg << "ReportExecStatus() to " << req.coord_addr << " failed:\n" << e.what(); - LOG(WARNING) << msg.str(); - rpc_status = Status::InternalError(msg.str()); + std::stringstream ss; + req.coord_addr.printTo(ss); + rpc_status = + Status::InternalError("ReportExecStatus() to {} failed: {}", ss.str(), e.what()); } if (!rpc_status.ok()) { @@ -1263,7 +1264,7 @@ Status FragmentMgr::apply_filterv2(const PPublishFilterRequestV2* request, std::shared_ptr<pipeline::PipelineFragmentContext> pip_context; RuntimeFilterMgr* runtime_filter_mgr = nullptr; - ObjectPool* pool; + ObjectPool* pool = nullptr; if (is_pipeline) { std::unique_lock<std::mutex> lock(_lock); auto iter = _pipeline_map.find(tfragment_instance_id); diff --git a/be/src/runtime/stream_load/stream_load_executor.cpp b/be/src/runtime/stream_load/stream_load_executor.cpp index 1ecba95748a..4a80eb35ca6 100644 --- a/be/src/runtime/stream_load/stream_load_executor.cpp +++ b/be/src/runtime/stream_load/stream_load_executor.cpp @@ -260,7 +260,7 @@ Status StreamLoadExecutor::begin_txn(StreamLoadContext* ctx) { #else result = k_stream_load_begin_result; #endif - status = Status::create(result.status); + status = Status::create<false>(result.status); } g_stream_load_begin_txn_latency << duration_ns / 1000; if (!status.ok()) { diff --git a/be/src/service/backend_service.cpp b/be/src/service/backend_service.cpp index f7e8321bfca..5dce58b5228 100644 --- a/be/src/service/backend_service.cpp +++ b/be/src/service/backend_service.cpp @@ -405,9 +405,7 @@ void BackendService::ingest_binlog(TIngestBinlogResult& result, }; if (!config::enable_feature_binlog) { - auto error_msg = "enable feature binlog is false"; - LOG(WARNING) << error_msg; - set_tstatus(TStatusCode::RUNTIME_ERROR, error_msg); + set_tstatus(TStatusCode::RUNTIME_ERROR, "enable feature binlog is false"); return; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/QeProcessorImpl.java b/fe/fe-core/src/main/java/org/apache/doris/qe/QeProcessorImpl.java index 86f0a111342..7dd661b58a7 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/QeProcessorImpl.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/QeProcessorImpl.java @@ -197,7 +197,7 @@ public final class QeProcessorImpl implements QeProcessor { } else { result.setStatus(new TStatus(TStatusCode.RUNTIME_ERROR)); } - LOG.info("ReportExecStatus() runtime error, query {} with type {} does not exist", + LOG.warn("ReportExecStatus() runtime error, query {} with type {} does not exist", DebugUtil.printId(params.query_id), params.query_type); return result; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org