-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grpc 服务注册失败时返回了成功 #11895
Comments
java sdk现在最新版本建立connection时,将等到server的response才会认为是连接建立成功,go的估计还是java sdk老版本的逻辑,发起连接后,等待指定默认时间就认为成功了,感觉一个是这里要抛出异常,还要一个go sdk也需要同步下java sdk的逻辑。 |
这里最好抛出异常,避免 sdk 等待时间不足,出现服务丢失的情况;go sdk 除了这个,还存在其他问题,也会导致服务丢失,我本地压测时,go sdk 需要修复这个bug,且 nacos server 也需要抛出异常时才能做到 nacos server 宕机重启服务数量不减少,服务不丢失; |
确实应该抛出异常更合理 |
nacos 建连后是发送事件,换言之,是异步将 connectionId 加入到 clientManager 里面的,go sdk 建连后,最快 100 毫秒就会注册服务,我们上线服务丢失,查询 log 发现:
Client connection xxx already disconnect
然后查询 go 的 log,发现真是丢失的服务的 connectionId,在高并发大量建连并注册的场景下,这里存在风险,建议抛出异常,而不是 return
The text was updated successfully, but these errors were encountered: