From 8c7a6f25f8fcc5725a63807c10a181a49394fbdf Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 24 Jul 2026 17:09:02 -0400 Subject: [PATCH] tune(artwork): drop backoff base from 5m to 15s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The exponential retry (base × 4^attempts, cap 48h) started at 5 minutes, so a single transient failure — a timeout under load, an external blip — parked a cover for 5 minutes even though a retry seconds later would have resolved it. Start at 15s instead: transient failures recover almost immediately (15s → 1m → 4m → 16m …), while persistent failures still escalate to the 48h cap (now at the 8th attempt instead of the 5th). --- core/artwork/worker.go | 2 +- core/artwork/worker_test.go | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/core/artwork/worker.go b/core/artwork/worker.go index 5513e0975..93efc51f8 100644 --- a/core/artwork/worker.go +++ b/core/artwork/worker.go @@ -22,7 +22,7 @@ import ( const ( workerPollInterval = 5 * time.Second - backoffBase = 5 * time.Minute + backoffBase = 15 * time.Second backoffCap = 48 * time.Hour breakerThreshold = 5 breakerProbeAfter = time.Minute diff --git a/core/artwork/worker_test.go b/core/artwork/worker_test.go index 9e1b43c5e..aab5f7e56 100644 --- a/core/artwork/worker_test.go +++ b/core/artwork/worker_test.go @@ -565,13 +565,15 @@ var _ = Describe("backoff", func() { attempts int want time.Duration }{ - {0, 5 * time.Minute}, - {1, 20 * time.Minute}, - {2, 80 * time.Minute}, - {3, 320 * time.Minute}, - {4, 1280 * time.Minute}, - {5, 48 * time.Hour}, - {6, 48 * time.Hour}, + {0, 15 * time.Second}, + {1, 60 * time.Second}, + {2, 4 * time.Minute}, + {3, 16 * time.Minute}, + {4, 64 * time.Minute}, + {5, 256 * time.Minute}, + {6, 1024 * time.Minute}, + {7, 48 * time.Hour}, + {8, 48 * time.Hour}, } { Expect(backoffFor(c.attempts, 0)).To(Equal(c.want), "attempt %d", c.attempts) } @@ -584,8 +586,8 @@ var _ = Describe("backoff", func() { }) It("keeps random jitter within +/-20%", func() { - lo := time.Duration(float64(320*time.Minute) * 0.8) - hi := time.Duration(float64(320*time.Minute) * 1.2) + lo := time.Duration(float64(16*time.Minute) * 0.8) + hi := time.Duration(float64(16*time.Minute) * 1.2) for range 200 { d := backoff(3) Expect(d).To(BeNumerically(">=", lo))