GreateCode commented on code in PR #2734:
URL: https://github.com/apache/brpc/pull/2734#discussion_r1712617908


##########
src/brpc/channel.cpp:
##########
@@ -495,8 +496,10 @@ void Channel::CallMethod(const 
google::protobuf::MethodDescriptor* method,
     // overriding connect_timeout_ms does not make sense, just use the
     // one in ChannelOptions
     cntl->_connect_timeout_ms = _options.connect_timeout_ms;
-    if (cntl->backup_request_ms() == UNSET_MAGIC_NUM) {
+    if (cntl->backup_request_ms() == UNSET_MAGIC_NUM &&
+        NULL != cntl->_backup_request_policy) {
         cntl->set_backup_request_ms(_options.backup_request_ms);
+        cntl->_backup_request_policy = _options.backup_request_policy;
     }

Review Comment:
   如果cntl没有设置backup_request_ms和backup_request_policy,channel 
options.backup_request_ms就给不到cntl了,是不是可以这样:
   ```
   if (cntl->backup_request_ms() == UNSET_MAGIC_NUM) {
       cntl->set_backup_request_ms(_options.backup_request_ms);
   }
   if (NULL != cntl->_backup_request_policy) {
       cntl->_backup_request_policy = _options.backup_request_policy;
   }
   ```



-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to