fix(web): keep the action status fetch alive when a client disconnects

The status fetch used the request context. A client that dropped the
connection, such as a readiness probe with a one second timeout,
cancelled the fetch. The failure was then cached and every later
request showed no action status. The fetch now ignores the caller
cancellation and keeps its own timeout.
This commit is contained in:
2026-10-05 15:53:52 +01:00
parent a0fd6d6856
commit 5c5416f6f0
2 changed files with 15 additions and 1 deletions
+2 -1
View File
@@ -158,7 +158,8 @@ func (a *Actions) statusRows(ctx context.Context, rt *actionRuntime) (map[alertR
if !rt.fetched.IsZero() && a.now().Sub(rt.fetched) < statusCacheTTL {
return rt.rows, rt.err
}
rows, err := a.fetchStatus(ctx, rt.cfg)
// A client that disconnects mid-request must not fail the fetch that every later request reuses.
rows, err := a.fetchStatus(context.WithoutCancel(ctx), rt.cfg)
if err != nil {
a.log.Warn("action status unavailable", "action", rt.cfg.ID, "err", err)
}