[Chore](status) adjust some error status print log (#24660)
adjust some error status print log
This commit is contained in:
@ -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 : ""));
|
||||
}
|
||||
|
||||
@ -350,14 +350,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>
|
||||
|
||||
@ -139,7 +139,7 @@ FragmentMgr::FragmentMgr(ExecEnv* exec_env)
|
||||
CHECK(s.ok()) << s.to_string();
|
||||
}
|
||||
|
||||
FragmentMgr::~FragmentMgr() {}
|
||||
FragmentMgr::~FragmentMgr() = default;
|
||||
|
||||
void FragmentMgr::stop() {
|
||||
DEREGISTER_HOOK_METRIC(plan_fragment_count);
|
||||
@ -185,9 +185,9 @@ void FragmentMgr::coordinator_callback(const ReportStatusRequest& req) {
|
||||
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()));
|
||||
req.update_fn(Status::InternalError(
|
||||
"query_id: {}, couldn't get a client for {}, reason is {}", uid.to_string(),
|
||||
PrintThriftNetworkAddress(req.coord_addr), coord_status.to_string()));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -322,12 +322,10 @@ 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());
|
||||
rpc_status = Status::InternalError("ReportExecStatus() to {} failed: {}",
|
||||
PrintThriftNetworkAddress(req.coord_addr), e.what());
|
||||
}
|
||||
|
||||
if (!rpc_status.ok()) {
|
||||
@ -1232,7 +1230,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);
|
||||
|
||||
@ -401,9 +401,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;
|
||||
}
|
||||
|
||||
|
||||
@ -209,7 +209,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user