One unreadable file stops the whole cache reconciliation pass #343

Closed
opened 2026-10-27 01:00:03 +01:00 by clawbot · 1 comment
Collaborator

One unreadable file or directory under the cache's storage directories stops the whole reconciliation pass, every time it runs.

Today (next at 2337650)

reconcileFiles in internal/imgcache/eviction.go walks a storage directory with filepath.WalkDir. An error reading an entry (passed in by the walk, or returned by reconcileVariantFile or reconcileSourceFile when they read a file's info) is returned from the walk. reconcileAccounting then returns at once, so the row check, the source-file check and the usage-total check never run. The same file stops the next pass the same way, so while it stays unreadable the accounting is never reconciled.

Definition of done

  • An entry that cannot be read during the walk is logged at warn, naming its path and the error, and the walk goes on to the next entry; the rest of the pass runs.
  • This holds for both walks, variants and sources.
  • A cancelled context still stops the walk, as now.
  • New tests in internal/imgcache, written first and failing against next, show a pass with one unreadable entry still reconciling the other files and running the later checks.

Tests

New tests only; no existing test changes.

Model: opus-5-5

One unreadable file or directory under the cache's storage directories stops the whole reconciliation pass, every time it runs. ## Today (`next` at `2337650`) `reconcileFiles` in `internal/imgcache/eviction.go` walks a storage directory with `filepath.WalkDir`. An error reading an entry (passed in by the walk, or returned by `reconcileVariantFile` or `reconcileSourceFile` when they read a file's info) is returned from the walk. `reconcileAccounting` then returns at once, so the row check, the source-file check and the usage-total check never run. The same file stops the next pass the same way, so while it stays unreadable the accounting is never reconciled. ## Definition of done - An entry that cannot be read during the walk is logged at warn, naming its path and the error, and the walk goes on to the next entry; the rest of the pass runs. - This holds for both walks, variants and sources. - A cancelled context still stops the walk, as now. - New tests in `internal/imgcache`, written first and failing against `next`, show a pass with one unreadable entry still reconciling the other files and running the later checks. ## Tests New tests only; no existing test changes. Model: opus-5-5
clawbot added this to the 1.0.0 milestone 2026-10-27 01:00:03 +01:00
clawbot self-assigned this 2026-10-27 01:00:03 +01:00
Author
Collaborator

#344 makes the reconciliation pass skip a directory it cannot list and a file whose info it cannot read. Each gets a warning naming its path and the error, and the pass goes on. The test uses paths over the 4096-byte limit Linux puts on a path, since the walk reads a link's own info and a link to itself never fails.

Model: opus-5-5

https://git.eeqj.de/sneak/pixa/pulls/344 makes the reconciliation pass skip a directory it cannot list and a file whose info it cannot read. Each gets a warning naming its path and the error, and the pass goes on. The test uses paths over the 4096-byte limit Linux puts on a path, since the walk reads a link's own info and a link to itself never fails. 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#343