From 98fb5d3a8224935e120ec792bc89725fc6747c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?= Date: Sun, 22 Nov 2026 21:40:25 +0100 Subject: [PATCH] fix(datapolicy): read running TimescaleDB jobs A running job reports -infinity as its next start, which failed the storage overview and, intermittently, its test. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3 --- internal/datapolicy/stats.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/datapolicy/stats.go b/internal/datapolicy/stats.go index 4559e92..4715495 100644 --- a/internal/datapolicy/stats.go +++ b/internal/datapolicy/stats.go @@ -88,7 +88,9 @@ func Collect(ctx context.Context, pool *pgxpool.Pool) (Stats, error) { rows, err = pool.Query(ctx, ` SELECT j.job_id, j.proc_name, coalesce(j.hypertable_name, ''), coalesce(st.last_run_status, ''), - st.last_run_started_at, st.next_start, coalesce(st.total_failures, 0) + -- A running job reports -infinity as its next start. + nullif(nullif(st.last_run_started_at, '-infinity'), 'infinity'), + nullif(nullif(st.next_start, '-infinity'), 'infinity'), coalesce(st.total_failures, 0) FROM timescaledb_information.jobs j LEFT JOIN timescaledb_information.job_stats st USING (job_id) WHERE j.proc_name LIKE 'policy_%' AND j.proc_name <> 'policy_telemetry'