diff --git a/be/src/service/internal_service.h b/be/src/service/internal_service.h index 04c0a86ef046eb..40e4bf0971af4f 100644 --- a/be/src/service/internal_service.h +++ b/be/src/service/internal_service.h @@ -41,18 +41,20 @@ class RuntimeState; template concept CanCancel = requires(T* response) { response->mutable_status(); }; -template -void offer_failed(T* response, google::protobuf::Closure* done, const FifoThreadPool& pool) { - brpc::ClosureGuard closure_guard(done); - LOG(WARNING) << "fail to offer request to the work pool, pool=" << pool.get_info(); -} +//template +//void offer_failed(T* response, google::protobuf::Closure* done, const FifoThreadPool& pool) { +// brpc::ClosureGuard closure_guard(done); +// LOG(WARNING) << "fail to offer request to the work pool, pool=" << pool.get_info(); +//} template void offer_failed(T* response, google::protobuf::Closure* done, const FifoThreadPool& pool) { brpc::ClosureGuard closure_guard(done); - response->mutable_status()->set_status_code(TStatusCode::CANCELLED); - response->mutable_status()->add_error_msgs("fail to offer request to the work pool, pool=" + - pool.get_info()); + // Should use status to generate protobuf message, because it will encoding Backend Info + // into the error message and then we could know which backend's pool is full. + Status st = Status::Error( + "fail to offer request to the work pool, pool={}", pool.get_info()); + st.to_protobuf(response->mutable_status()); LOG(WARNING) << "cancelled due to fail to offer request to the work pool, pool=" << pool.get_info(); }