zeromicro / zero-contrib

A collection of extensions and tools for go-zero.
184 stars 77 forks source link

nacos sdk,error: context deadline exceeded, make sure rpc service #326

Open teleJa opened 4 months ago

teleJa commented 4 months ago

使用nacos作为注册中心后,client端调用报错如题所示 原因如下: 1.zero-contrib中的builder订阅nacos服务实例,但由于nacos sdk的服务缓存cache存在导致服务无变更的场景下,该订阅无法收到nacos的消息推送,从而无法处理回调,导致超时 image image 2.临时规避 client端手动设置下环境变量避免使用缓存 image

image

gpt机翻英文 After using Nacos as the service registry center, the client encounters an error as described in the title when making a call.

The reasons are as follows:

In the zero-contrib library, the builder subscribes to Nacos service instances. However, due to the existence of the service cache in the Nacos SDK, which acts as a cache, under scenarios where the service remains unchanged, this subscription is unable to receive message pushes from Nacos, thus preventing the handling of the callback, which leads to a timeout,The client manually sets the environment variables to avoid using the cache. image

image