From 04c97db73e2270c14c1feb87264d9bd32ec439d5 Mon Sep 17 00:00:00 2001 From: Jaz Volpert Date: Tue, 31 Oct 2023 20:28:49 +0000 Subject: [PATCH 1/2] Don't access the state when processing errors --- bgs/compactor.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bgs/compactor.go b/bgs/compactor.go index da6fc052f..7997b4a5c 100644 --- a/bgs/compactor.go +++ b/bgs/compactor.go @@ -248,10 +248,6 @@ func (c *Compactor) doWork(bgs *BGS) { } log.Errorw("failed to compact repo", "err", err, - "uid", state.latestUID, - "repo", state.latestDID, - "status", state.status, - "stats", state.stats, "duration", time.Since(start), ) // Pause for a bit to avoid spamming failed compactions From d4de487213f3a1ccfef132394064ce735b1fac89 Mon Sep 17 00:00:00 2001 From: Jaz Volpert Date: Tue, 31 Oct 2023 20:31:30 +0000 Subject: [PATCH 2/2] Explicitly get state when error logging --- bgs/compactor.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bgs/compactor.go b/bgs/compactor.go index 7997b4a5c..cb9609d82 100644 --- a/bgs/compactor.go +++ b/bgs/compactor.go @@ -246,8 +246,13 @@ func (c *Compactor) doWork(bgs *BGS) { time.Sleep(time.Second * 5) continue } + state = c.GetState() log.Errorw("failed to compact repo", "err", err, + "uid", state.latestUID, + "repo", state.latestDID, + "status", state.status, + "stats", state.stats, "duration", time.Since(start), ) // Pause for a bit to avoid spamming failed compactions