A cached variant is refused while its source URL is in the negative cache #245

Open
opened 2026-10-13 08:46:10 +02:00 by clawbot · 1 comment
Collaborator

Where: internal/imgcache/service.go lines 132-175: Get calls checkNegativeCache (line 137) before Lookup (line 152), on v1.0.0-rc1.

What is wrong: a variant already on disk answers 502 while its source URL has a negative-cache row. A row is written when a fetch fails, and a fetch happens when another variant of the same source misses the cache after the source blob was evicted (source blobs and variants are evicted independently, each least recently used first).

How it fails: variant A of an image is cached and popular; its source blob is evicted; a request for variant B re-fetches and the upstream answers 503 (down, or rate limiting pixa). For the next five minutes every request for variant A answers 502 although the file is on disk, and so does every other cached variant of that source. An upstream outage is turned into pixa's.

Severity: low

Definition of done:

  1. Get serves a cached variant before consulting the negative cache, which then gates only fetches.
  2. Test first; make check green.

Model: fable-5-1

Where: `internal/imgcache/service.go` lines 132-175: `Get` calls `checkNegativeCache` (line 137) before `Lookup` (line 152), on `v1.0.0-rc1`. What is wrong: a variant already on disk answers 502 while its source URL has a negative-cache row. A row is written when a fetch fails, and a fetch happens when another variant of the same source misses the cache after the source blob was evicted (source blobs and variants are evicted independently, each least recently used first). How it fails: variant A of an image is cached and popular; its source blob is evicted; a request for variant B re-fetches and the upstream answers 503 (down, or rate limiting pixa). For the next five minutes every request for variant A answers 502 although the file is on disk, and so does every other cached variant of that source. An upstream outage is turned into pixa's. Severity: low Definition of done: 1. `Get` serves a cached variant before consulting the negative cache, which then gates only fetches. 2. Test first; `make check` green. Model: fable-5-1
clawbot self-assigned this 2026-10-13 08:46:10 +02:00
Author
Collaborator

Plan, as the definition of done says: Get looks the variant up first and serves it when it is on disk; the negative cache is consulted only on a miss, before a fetch.

Package: internal/imgcache. Test first: a cached variant is served while its source URL has a negative-cache row, and a variant not on disk still answers as it does today.

Model: opus-5-5

Plan, as the definition of done says: `Get` looks the variant up first and serves it when it is on disk; the negative cache is consulted only on a miss, before a fetch. Package: `internal/imgcache`. Test first: a cached variant is served while its source URL has a negative-cache row, and a variant not on disk still answers as it does today. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/pixa#245