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

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


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

commit cb24ccc112bc263dd33121931e9df3c04b2f2be8
Author: yiguolei <676222...@qq.com>
AuthorDate: Fri Oct 4 23:03:55 2024 +0800

    [bugfix](brpc) Should use status to generate protobuf message, because it 
will encoding Backend Info (#41515) (#41522)
    
    Should use status to generate protobuf message, because it will encoding
    Backend Info
    
    ## Proposed changes
    
    Issue Number: close #xxx
    
    <!--Describe your changes.-->
---
 be/src/service/internal_service.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/be/src/service/internal_service.cpp 
b/be/src/service/internal_service.cpp
index 04e616b53b7..c54881ed82e 100644
--- a/be/src/service/internal_service.cpp
+++ b/be/src/service/internal_service.cpp
@@ -189,9 +189,11 @@ concept CanCancel = requires(T* response) { 
response->mutable_status(); };
 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