diff --git a/client/base_client.go b/client/base_client.go index 556dde16032..98c802cfd21 100644 --- a/client/base_client.go +++ b/client/base_client.go @@ -140,15 +140,14 @@ func (c *baseClient) memberLoop() { case <-c.checkLeaderCh: case <-ticker.C: case <-ctx.Done(): - log.Info("[pd.memberLoop] exit memberLoop") + log.Info("[pd] exit member loop") return } failpoint.Inject("skipUpdateMember", func() { failpoint.Continue() }) - if err := retry.WithBackoff(ctx, c.updateMember, &bo); err != nil { - log.Info("[pd] failed update member with retry", errs.ZapError(err)) + log.Error("[pd] failed update member with retry", errs.ZapError(err)) } } } diff --git a/client/go.mod b/client/go.mod index 09e0c7e7aca..c8055548f23 100644 --- a/client/go.mod +++ b/client/go.mod @@ -12,7 +12,6 @@ require ( github.com/prometheus/client_golang v1.11.1 github.com/stretchr/testify v1.7.0 go.uber.org/goleak v1.1.11 - go.uber.org/multierr v1.7.0 go.uber.org/zap v1.20.0 golang.org/x/text v0.3.8 // indirect google.golang.org/grpc v1.43.0 diff --git a/client/retry/backoff.go b/client/retry/backoff.go index a8c1fe2ed9f..ffb78fc7d48 100644 --- a/client/retry/backoff.go +++ b/client/retry/backoff.go @@ -19,7 +19,6 @@ import ( "time" "github.com/pingcap/failpoint" - "go.uber.org/multierr" ) // BackOffer is a backoff policy for retrying operations. @@ -35,13 +34,11 @@ func WithBackoff( fn func() error, bo *BackOffer, ) error { - var allErrors error err := fn() if err != nil { - allErrors = multierr.Append(allErrors, err) select { case <-ctx.Done(): - return allErrors + return err case <-time.After(bo.NextBackoff()): failpoint.Inject("backOffExecute", func() { testBackOffExecuteFlag = true @@ -51,7 +48,7 @@ func WithBackoff( bo.ResetBackoff() return nil } - return allErrors + return err } // InitialBackOffer make the initial state for retrying.