No-SilverBullet commented on code in PR #3108:
URL: https://github.com/apache/dubbo-go/pull/3108#discussion_r2618456924
##########
registry/servicediscovery/service_discovery_registry.go:
##########
@@ -133,14 +137,31 @@ func createInstance(meta *info.MetadataInfo, url
*common.URL) registry.ServiceIn
}
func (s *serviceDiscoveryRegistry) UnRegisterService() error {
- return s.serviceDiscovery.Unregister(s.instance)
+ s.lock.Lock()
+ defer s.lock.Unlock()
Review Comment:
the lock is acquired and then the unregister operation is performed.
Unregistering involves synchronously calling the registry center's (nacos,
zk....)API via the network. Could this lead to the lock being held for too
long, impacting performance? just a suggestion you can evaluate it.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]