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


##########
src/brpc/socket.h:
##########
@@ -266,6 +266,8 @@ struct SocketOptions {
     // one thread at any time.
     void (*on_edge_triggered_events)(Socket*){NULL};
     int health_check_interval_s{-1};
+    std::string health_check_path;

Review Comment:
   Can change these two members to a single HealthCheckOption member



##########
src/brpc/channel.h:
##########
@@ -143,6 +143,18 @@ struct ChannelOptions {
     // Default: ""
     std::string connection_group;
 
+    // Set the health check path according to the channel granularity. 
+    // Its priority is higher than FLAGS_health_check_path
+    // When it is not set, FLAGS_health_check_path will take effect
+    // Default: ""
+    std::string health_check_path;

Review Comment:
   Can change these two members to a single HealthCheckOption member



##########
src/brpc/channel.cpp:
##########
@@ -388,6 +408,10 @@ int Channel::Init(const char* ns_url,
     ns_opt.log_succeed_without_server = _options.log_succeed_without_server;
     ns_opt.use_rdma = _options.use_rdma;
     ns_opt.channel_signature = ComputeChannelSignature(_options);

Review Comment:
   maybe these hc options should be included in ComputeChannelSignature



##########
src/brpc/socket_map.h:
##########
@@ -44,6 +44,11 @@ inline bool operator!=(const ChannelSignature& s1, const 
ChannelSignature& s2) {
     return !(s1 == s2);
 }
 
+struct HealthCheckOption {
+    std::string health_check_path;
+    int32_t health_check_timeout_ms = 500;

Review Comment:
   better initialize like this: `int32_t health_check_timeout_ms{500};`



##########
src/brpc/details/naming_service_thread.h:
##########
@@ -45,11 +45,14 @@ struct GetNamingServiceThreadOptions {
     GetNamingServiceThreadOptions()
         : succeed_without_server(false)
         , log_succeed_without_server(true)
-        , use_rdma(false) {}
+        , use_rdma(false) 
+        , health_check_timeout_ms(500) {}
     
     bool succeed_without_server;
     bool log_succeed_without_server;
     bool use_rdma;
+    int32_t health_check_timeout_ms;

Review Comment:
   Can change these two members to a single HealthCheckOption member



-- 
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