You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/08/27 05:08:54 UTC

[GitHub] [incubator-brpc] zzszmyf opened a new pull request #1220: replace HealthCheckThread to StartHealthCheck in docs/comments #1209

zzszmyf opened a new pull request #1220:
URL: https://github.com/apache/incubator-brpc/pull/1220


   


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

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



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


[GitHub] [incubator-brpc] zyearn commented on a change in pull request #1220: replace HealthCheckThread to StartHealthCheck in docs/comments #1209

Posted by GitBox <gi...@apache.org>.
zyearn commented on a change in pull request #1220:
URL: https://github.com/apache/incubator-brpc/pull/1220#discussion_r478481513



##########
File path: src/brpc/socket.h
##########
@@ -333,7 +333,7 @@ friend class policy::H2GlobalStreamCreator;
 
     // Mark this Socket or the Socket associated with `id' as failed.
     // Any later Address() of the identifier shall return NULL unless the
-    // Socket was revivied by HealthCheckThread. The Socket is NOT recycled
+    // Socket was revivied by StartHealthCheck. The Socket is NOT recycled

Review comment:
       这里改成HealthCheckTask更合适一点?

##########
File path: docs/cn/load_balancing.md
##########
@@ -40,7 +40,7 @@ Load balancer最重要的是如何让不同线程中的负载均衡不互斥,
 
 对于那些无法连接却仍在NamingService的节点,brpc会定期连接它们,成功后对应的Socket将被”复活“,并可能被LoadBalancer选择上,这个过程就是健康检查。注意:被健康检查或在LoadBalancer中的节点一定在NamingService中。换句话说,只要一个节点不从NamingService删除,它要么是正常的(会被LoadBalancer选上),要么在做健康检查。
 
-传统的做法是使用一个线程做所有连接的健康检查,brpc简化了这个过程:为需要的连接动态创建一个bthread专门做健康检查(Socket::HealthCheckThread)。这个线程的生命周期被对应连接管理。具体来说,当Socket被SetFailed后,健康检查线程就可能启动(如果SocketOptions.health_check_interval为正数的话):
+传统的做法是使用一个线程做所有连接的健康检查,brpc简化了这个过程:为需要的连接动态创建一个bthread专门做健康检查(Socket::StartHealthCheck)。这个线程的生命周期被对应连接管理。具体来说,当Socket被SetFailed后,健康检查线程就可能启动(如果SocketOptions.health_check_interval为正数的话):

Review comment:
       多谢领取这个[issue](https://github.com/apache/incubator-brpc/issues/1209)。
   
   改的时候需要注意一点:不仅仅只是把HealthCheckThread替换成StartHealthCheck。
   由于原来的HealthCheckThread是个bthread,所以在原来的上下文是通顺的,而StartHealthCheck新建了一个由timer处理的任务,这里的上下文需要对应的修改一下。

##########
File path: test/brpc_socket_unittest.cpp
##########
@@ -536,7 +536,7 @@ TEST_F(SocketTest, not_health_check_when_nref_hits_0) {
         ASSERT_TRUE(src.empty());
         ASSERT_EQ(-1, s->fd());
     }
-    // HealthCheckThread is possibly still running. Spin until global_sock
+    // StartHealthCheck is possibly still running. Spin until global_sock

Review comment:
       这里以及下面的StartHealthCheck 换成 HealthCheckTask 可能更恰当一点




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

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



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