wwbmmm commented on code in PR #2177:
URL: https://github.com/apache/brpc/pull/2177#discussion_r1168294541


##########
src/brpc/controller.cpp:
##########
@@ -1033,7 +1054,13 @@ void Controller::IssueRPC(int64_t start_realtime_us) {
             { start_realtime_us, true,
               has_request_code(), _request_code, _accessed };
         LoadBalancer::SelectOut sel_out(&tmp_sock);
-        const int rc = _lb->SelectServer(sel_in, &sel_out);
+        int rc = _lb->SelectServer(sel_in, &sel_out);
+        if (rc == EHOSTDOWN) {
+            // If no server is available, include accessed server and try to 
SelectServer again
+            sel_in.excluded = NULL;

Review Comment:
   
目前excluded的实例是在之前的重试中选过的实例,如果返回EHOSTDOWN说明已经没有实例可选,RPC必然失败,那就退而求其次,选择excluded中的实例,这样还有成功的可能



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to