Skip to content
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

Closed
ijustyce opened this issue Mar 29, 2024 · 3 comments
Closed

grpc 服务注册失败时返回了成功 #11895

ijustyce opened this issue Mar 29, 2024 · 3 comments
Labels
area/Naming kind/enhancement Category issues or prs related to enhancement.

Comments

@ijustyce
Copy link

图片 这里,应该抛出异常,而不是简单返回;

nacos 建连后是发送事件,换言之,是异步将 connectionId 加入到 clientManager 里面的,go sdk 建连后,最快 100 毫秒就会注册服务,我们上线服务丢失,查询 log 发现:
Client connection xxx already disconnect
然后查询 go 的 log,发现真是丢失的服务的 connectionId,在高并发大量建连并注册的场景下,这里存在风险,建议抛出异常,而不是 return

@ijustyce ijustyce changed the title grpc 服务注册失败时吞掉了异常,返回了成功 grpc 服务注册失败时返回了成功 Mar 29, 2024
@stone-98
Copy link
Contributor

stone-98 commented Mar 29, 2024

java sdk现在最新版本建立connection时,将等到server的response才会认为是连接建立成功,go的估计还是java sdk老版本的逻辑,发起连接后,等待指定默认时间就认为成功了,感觉一个是这里要抛出异常,还要一个go sdk也需要同步下java sdk的逻辑。

@ijustyce
Copy link
Author

java sdk现在最新版本建立connection时,将等到server的response才会认为是连接建立成功,go的估计还是java sdk老版本的逻辑,发起连接后,等待指定默认时间就认为成功了,感觉一个是这里要抛出异常,还要一个go sdk也需要同步下java sdk的逻辑。

这里最好抛出异常,避免 sdk 等待时间不足,出现服务丢失的情况;go sdk 除了这个,还存在其他问题,也会导致服务丢失,我本地压测时,go sdk 需要修复这个bug,且 nacos server 也需要抛出异常时才能做到 nacos server 宕机重启服务数量不减少,服务不丢失;

@Bo-Qiu
Copy link
Contributor

Bo-Qiu commented Apr 1, 2024

确实应该抛出异常更合理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Naming kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

No branches or pull requests

4 participants