go-kratos / kratos

Your ultimate Go microservices framework for the cloud-native era.
https://go-kratos.dev
MIT License
23.41k stars 4.01k forks source link

fix: The intermittent abnormality of etcd has caused registration failure #3464

Open fltfh opened 1 week ago

fltfh commented 1 week ago

What happened:

etcd 短时间内出现两次异常后,部分服务没有注册到etcd中。复现发现代码中只重试了一次(配置最大5次),然后就退出了。

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

kratos

Anything else we need to know?:

复现方式: 部署三节点etcd集群,在其中两台机器上, 通过iptables, 5秒禁用2379,2380端口,然后5秒开启。 就会出现未到最大重试次数,就退出。

Environment: