You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "wwbmmm (via GitHub)" <gi...@apache.org> on 2023/02/13 03:50:54 UTC

[GitHub] [brpc] wwbmmm commented on a diff in pull request #2123: Periodic ns quit

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


##########
src/brpc/periodic_naming_service.cpp:
##########
@@ -37,9 +37,13 @@ int PeriodicNamingService::RunNamingService(
     const char* service_name, NamingServiceActions* actions) {
     std::vector<ServerNode> servers;
     bool ever_reset = false;
-    for (;;) {
+    while (true) {
         servers.clear();
         const int rc = GetServers(service_name, &servers);
+        if (bthread_stopped(bthread_self())) {

Review Comment:
   这个放在57行的位置会不会更合适



-- 
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-unsubscribe@brpc.apache.org

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