Skip to content

fix(snapshot): check ignored errors and enforce errcheck in internal/snapshot - #108

Merged
mattmattox merged 1 commit into
mainfrom
claude/errcheck-snapshot
Nov 13, 2026
Merged

mattmattox merged 1 commit into
mainfrom
claude/errcheck-snapshot

Conversation

@mattmattox

Copy link
Copy Markdown
Contributor

Fixes all 48 errcheck findings in internal/snapshot and adds the package to the errcheck path-except rule. 398 findings remain elsewhere.

journal, storage and refcount, the other packages on the PM's list, have been enforced since #31.

Ignored error that could hide corruption: the registry released its lock in five places and ignored the result. If Release returns ErrNotLockOwner, this node released the lock twice. The extra release may have dropped another holder's lock early, letting two writers update snapshot descriptors at once. That case is now an [ERROR], and other release failures are a [WARN]. This is the same handling #95 gave the inode table.

Tests: setup calls (Create, UpdateState, Delete, Scan, and the benchmark loops) now fail the test on error. Cleanup errors are discarded explicitly. #103 also edits worker_test.go, at its imports and from line 654; this PR changes lines 42–61, so they shouldn't conflict.

🤖 Generated with Claude Code

…snapshot

- The snapshot registry dropped the error from releasing its lock.
  ErrNotLockOwner there means a double release, which may have dropped
  another holder's registry lock early so two writers updated
  descriptors at once. It is now logged as an error; other release
  failures log a warning.
- Tests check setup steps (Create, UpdateState, Delete, Scan) and
  discard cleanup errors explicitly.

errcheck now covers internal/snapshot; 398 findings remain elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox
mattmattox merged commit fcf086b into main Nov 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant