From 5529cb7347ce6f9c375fc28e95581f2f5d6b6bb9 Mon Sep 17 00:00:00 2001 From: Paul Banks Date: Thu, 18 Feb 2021 16:13:51 +0000 Subject: [PATCH] Tune streaming backoff on errors to retry a bit faster when TCP connections drop --- agent/cache-types/streaming_health_services.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/agent/cache-types/streaming_health_services.go b/agent/cache-types/streaming_health_services.go index 6491383456..8305c54e5c 100644 --- a/agent/cache-types/streaming_health_services.go +++ b/agent/cache-types/streaming_health_services.go @@ -113,9 +113,13 @@ func newMaterializer( Logger: deps.Logger, Waiter: &retry.Waiter{ MinFailures: 1, - MinWait: 0, - MaxWait: 60 * time.Second, - Jitter: retry.NewJitter(100), + // Start backing off with small increments (200-400ms) which will double + // each attempt. (200-400, 400-800, 800-1600, 1600-3200, 3200-6000, 6000 + // after that). (retry.Wait applies Max limit after jitter right now). + Factor: 200 * time.Millisecond, + MinWait: 0, + MaxWait: 60 * time.Second, + Jitter: retry.NewJitter(100), }, Request: newRequestFn, }), nil