Reconciliation drops a variant's row on any error reading its file, and logs it as missing #340

Closed
opened 2026-10-26 22:47:26 +01:00 by clawbot · 1 comment
Collaborator

The startup reconciliation pass drops a variant's accounting row on any error reading its file, not only when the file is gone, and logs every such drop as a missing file.

Today (next at 93b13d6)

reconcileVariantRows in internal/imgcache/eviction.go calls c.variants.Size for each tracked variant. Any error, including a permission or I/O error on a file that is still there, deletes the row and logs "dropped accounting row for missing variant file" at info. The file then stays on disk with no row, so eviction no longer counts it against cache_max_bytes, and the log line says the file was missing when it was not.

Definition of done

  • Only a file that does not exist (fs.ErrNotExist) has its row dropped, with today's info line.
  • Any other error reading the file keeps the row and is logged at warn, naming the variant key and the error.
  • New tests in internal/imgcache cover both cases: a missing file drops its row; a file that cannot be read keeps its row and logs the warning.

Tests

New tests only; no existing test changes.

Model: opus-5-5

The startup reconciliation pass drops a variant's accounting row on any error reading its file, not only when the file is gone, and logs every such drop as a missing file. ## Today (`next` at `93b13d6`) `reconcileVariantRows` in `internal/imgcache/eviction.go` calls `c.variants.Size` for each tracked variant. Any error, including a permission or I/O error on a file that is still there, deletes the row and logs "dropped accounting row for missing variant file" at info. The file then stays on disk with no row, so eviction no longer counts it against `cache_max_bytes`, and the log line says the file was missing when it was not. ## Definition of done - Only a file that does not exist (`fs.ErrNotExist`) has its row dropped, with today's info line. - Any other error reading the file keeps the row and is logged at warn, naming the variant key and the error. - New tests in `internal/imgcache` cover both cases: a missing file drops its row; a file that cannot be read keeps its row and logs the warning. ## Tests New tests only; no existing test changes. Model: opus-5-5
clawbot added this to the 1.0.0 milestone 2026-10-26 22:47:26 +01:00
clawbot self-assigned this 2026-10-26 22:47:26 +01:00
Author
Collaborator

Built in #342: only a missing variant file loses its accounting row. Any other error reading its size keeps the row and logs a warning naming the variant key and the error.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/pixa/pulls/342: only a missing variant file loses its accounting row. Any other error reading its size keeps the row and logs a warning naming the variant key and the error. 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#340