Skip to content

channels SWR follow-ups to #517: recover in background refresh, honour cache reset #519

Closed

Description

@dborup

Follow-ups from the #517 review ("Review — CS-pve-agent1 PR#517"). Fix these before the next release:

  1. Recover in the background refresh (must fix). The stale-while-revalidate goroutine runs query() without recover. A panic in the query kills the whole server process instead of failing one request; the HTTP handler only recovers on the synchronous path. Add a recover that logs, keeps the stale entry and lets a later retry run. Add a test with a panicking query that proves the process survives and the stale entry is still served.
  2. Honour reset() (nit). A refresh started before a cache reset, for example from the decode backfill, can finish afterwards and put its pre-reset result. Add a generation or epoch check so a refresh that started before a reset does not store its result. Test it.
  3. Optional (info): re-check for a fresh entry before the background query, as the synchronous flight does.

Keep the #499 correctness tests and the #495 lock rule.

Activity

  1. dborup commented on Oct 21, 2026

    @dborup
    OwnerAuthor

    Fixed by #520 (merged as d18ffd2cc50b626628d3f32695b5ba59806a70d6).Fixed by #520: the channels SWR background refresh recovers from panics (the process survives and the stale entry is still served), and a refresh started before a cache reset no longer stores its result. APPROVE, CI green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions