Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Shared bbolt-failure classifier in tollwallet — one parser for degraded-mode reasons and wallet-check verdicts (follow-up from #741/#743 reviews)

Open
#825 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
18/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
databases

Research direction

Start by reading IsStorageMmapUnsupported in tollwallet (mmap_compat.go) and mapWorkerOutcome in src/cmd/tollgate-cli/wallet_check.go, which are the two parsers to merge. Design the shared ClassifyStorageFailure and its class enum in tollwallet/storage_failure.go, keeping worker-process isolation for any bbolt open used by checks. Done when both consumers become thin adapters over the shared classifier and the existing classifier table and seeded-corruption tests pass against it.

Written by the indexing model from the issue text.

Description

Summary

#741's review (follow-up 2) + #743's review (fragility note) converge on the same structural point: two ad-hoc parsers of bbolt failure modes will drift. Today the corruption-vs-unsupported distinction exists in two places:

  • #741: tollwallet.IsStorageMmapUnsupported — errno-chain/errno-text classification for storage unsupported (degraded-mode entry, honest error strings);
  • #743: src/cmd/tollgate-cli/wallet_check.go — open-error vs check-findings vs worker-death verdicts for corruption (the crash-isolated wallet check).

A shared classifier in tollwallet should serve both: one place that turns a bbolt-layer error (or worker outcome) into the named failure classes — storage-unsupported (#583 jffs2/mmap), corrupt-or-unreadable (open/check/panic/SIGBUS shapes), locked (#742's ErrWalletLocked), absent, other — with each consumer mapping classes to its surface (degraded-mode reason strings vs CLI verdicts/exit codes).

Constraints to carry (from the reviews)

  • The corruption classes must keep worker-process isolation wherever bbolt is actually opened for checking (#743's fragility note: running bbolt Open in-process for a check command reintroduces the panic-on-corruption surface the worker exists to contain).
  • errors.Is first, errno-text fallback stays necessary while gonuts wraps with %v (#743's audit note).
  • Consumers: degraded-mode entry + walletUnavailableReason() (#741), wallet check verdict mapping (mapWorkerOutcome) + any future status surface (see the sibling follow-up #824).

Proposed

tollwallet/storage_failure.go (or extend mmap_compat.go): exported ClassifyStorageFailure(err error) StorageFailureClass + the class enum; #741's boolean and #743's verdict mapping become thin adapters over it. Tests: the existing classifier table (#741) + the seeded-corruption matrix (#743) both re-pointed at the shared classification.

References

  • Review asks: #741 review (follow-up 2), #743 review (fragility note)
Dominant language
Go
Stars
12
Forks
14
Avg merge
1d 5h
Merged PRs (30d)
239

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenTollGate/tollgate-module-basic-go

All issues in OpenTollGate/tollgate-module-basic-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.