From ea8642e2a17bb1e6b535b31db30bf22d065866fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUISSON?= Date: Mon, 1 Feb 2021 14:42:04 +0100 Subject: [PATCH] fix: reduce pressure of pilot services when errors occurs --- pkg/pilot/pilot.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/pilot/pilot.go b/pkg/pilot/pilot.go index 73d6876bb..9edd984c6 100644 --- a/pkg/pilot/pilot.go +++ b/pkg/pilot/pilot.go @@ -33,6 +33,8 @@ const ( pilotInstanceInfoTimer = 5 * time.Minute pilotDynConfTimer = 12 * time.Hour maxElapsedTime = 4 * time.Minute + initialInterval = 5 * time.Second + multiplier = 3 ) type instanceInfo struct { @@ -219,6 +221,8 @@ func (c *client) SendInstanceInfo(ctx context.Context, pilotMetrics []metrics.Pi func (c *client) sendDataRetryable(ctx context.Context, req *http.Request) error { exponentialBackOff := backoff.NewExponentialBackOff() exponentialBackOff.MaxElapsedTime = maxElapsedTime + exponentialBackOff.InitialInterval = initialInterval + exponentialBackOff.Multiplier = multiplier req.Header.Set("Content-Type", "application/json") req.Header.Set(tokenHashHeader, c.tokenHash)