xxs588 commented on code in PR #3270:
URL: https://github.com/apache/dubbo-go/pull/3270#discussion_r2988344162
##########
registry/directory/directory.go:
##########
@@ -523,9 +541,7 @@ func (dir *RegistryDirectory) List(invocation
protocolbase.Invocation) []protoco
routerChain := dir.RouterChain()
if routerChain == nil {
- dir.invokersLock.RLock()
- defer dir.invokersLock.RUnlock()
- return dir.cacheInvokers
+ return dir.snapshotCacheInvokers()
}
return routerChain.Route(dir.consumerURL, invocation)
Review Comment:
感谢建议,已修复,Route() 不再直接读 c.invokers,改为先走 snapshotInvokers()
拿快照再路由,对cluster/router全包进行了测试,通过
这是修复的地方
<img width="1105" height="805" alt="图片"
src="https://github.com/user-attachments/assets/dfcab3dc-3da5-4b55-9f52-149254bbd134"
/>
--
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]