This is an automated email from the ASF dual-hosted git repository.

panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new e93587aff47 [bugfix](brpc) Should use status to generate protobuf 
message, because it will encoding Backend Info (#41515)
e93587aff47 is described below

commit e93587aff479c75d4066e38cca45873a9c1d7ce8
Author: yiguolei <676222...@qq.com>
AuthorDate: Wed Oct 2 19:14:05 2024 +0800

    [bugfix](brpc) Should use status to generate protobuf message, because it 
will encoding Backend Info (#41515)
    
    Should use status to generate protobuf message, because it will encoding 
Backend Info
---
 be/src/service/internal_service.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/be/src/service/internal_service.h 
b/be/src/service/internal_service.h
index 04c0a86ef04..b3ab1c5a647 100644
--- a/be/src/service/internal_service.h
+++ b/be/src/service/internal_service.h
@@ -50,9 +50,11 @@ void offer_failed(T* response, google::protobuf::Closure* 
done, const FifoThread
 template <CanCancel T>
 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<TStatusCode::CANCELLED>(
+            "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();
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to