From 43949da2adc762e8587a20fb4522fa4af190c5b3 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Mon, 6 Jan 2025 16:12:16 +0800 Subject: [PATCH] client: retry checkServiceModeChanged to make tso client work normal (#8963) (#8974) close tikv/pd#8962 Signed-off-by: okJiang <819421878@qq.com> Co-authored-by: okJiang <819421878@qq.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com> --- client/pd_service_discovery.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/pd_service_discovery.go b/client/pd_service_discovery.go index 872b8e0ad0b..10eacb0b57c 100644 --- a/client/pd_service_discovery.go +++ b/client/pd_service_discovery.go @@ -506,8 +506,9 @@ func (c *pdServiceDiscovery) Init() error { } } - if err := c.checkServiceModeChanged(); err != nil { - log.Warn("[pd] failed to check service mode and will check later", zap.Error(err)) + if err := c.initRetry(c.checkServiceModeChanged); err != nil { + c.cancel() + return err } c.wg.Add(3)