You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/07/07 06:20:45 UTC

[GitHub] [dubbo-go] pantianying commented on a change in pull request #644: Fix: waitGroup use

pantianying commented on a change in pull request #644:
URL: https://github.com/apache/dubbo-go/pull/644#discussion_r450634656



##########
File path: registry/zookeeper/registry.go
##########
@@ -134,6 +134,7 @@ func (r *zkRegistry) InitListeners() {
 					regConfigListener.Close()
 				}
 				newDataListener.SubscribeURL(conf, NewRegistryConfigurationListener(r.client, r))
+				r.WaitGroup().Add(1)
 				go r.listener.ListenServiceEvent(conf, fmt.Sprintf("/dubbo/%s/"+constant.DEFAULT_CATEGORY, url.QueryEscape(conf.Service())), newDataListener)

Review comment:
       Waitgroup is only used to record the number of goruntines. It is not intended to be bound to the listenserviceevent method

##########
File path: registry/zookeeper/registry.go
##########
@@ -134,6 +134,7 @@ func (r *zkRegistry) InitListeners() {
 					regConfigListener.Close()
 				}
 				newDataListener.SubscribeURL(conf, NewRegistryConfigurationListener(r.client, r))
+				r.WaitGroup().Add(1)
 				go r.listener.ListenServiceEvent(conf, fmt.Sprintf("/dubbo/%s/"+constant.DEFAULT_CATEGORY, url.QueryEscape(conf.Service())), newDataListener)

Review comment:
       Waitgroup is only used to record the number of goruntines. It is not intended to be bound to the listenserviceevent method




----------------------------------------------------------------
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: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org