Skip to content

fix(storage): remove stray debug println from FileDeviceBuilder::build - #22

Open
detail-app[bot] wants to merge 1 commit into
mainfrom
detail/bug-fix/fix-storage-remove-stray-debug-println-from-filede-4d2d2f
Open

detail-app[bot] wants to merge 1 commit into
mainfrom
detail/bug-fix/fix-storage-remove-stray-debug-println-from-filede-4d2d2f

Conversation

@detail-app

@detail-app detail-app Bot commented Sep 11, 2026

Copy link
Copy Markdown

Detail bug report: View on Detail

Bug

FileDeviceBuilder::build in foyer-storage/src/io/device/file.rs printed the resolved device capacity to stdout on every device construction via a stray println!("==========> {capacity}");. Added as an ad-hoc debug marker alongside an unrelated capacity-calculation fix, it slipped through review.

FileDeviceBuilder is part of the public API (re-exported through the foyer-storage and foyer preludes) and build() runs on every FileDevice construction, so the line leaked unconditional stdout to all library consumers — bypassing the repo's tracing-based logging (the same function calls tracing::warn! a few lines later) with no log-level filter or sink routing.

Fix

Deleted the println! line. The printed value was observational only and never affected the aligned capacity used to size the device, so removal is behavior-preserving aside from dropping the unwanted stdout. No replacement diagnostic was added — the surrounding code already routes diagnostics through tracing, so deletion restores the codebase convention. This was the only println! in foyer-storage library impl code (the remaining one lives inside a #[test] body).

Testing

  • Fixed path: io::engine::tests::test_io_engine (calls FileDeviceBuilder::build) passes; under --nocapture no ==========> line reaches stdout.
  • Stdout assertion via an isolated test program that constructs a FileDevice: captured stdout is empty (no marker). Re-inserting the println! reproduced ==========> <capacity> on stdout, and removing it cleared it — confirming the check is sensitive to the bug.
  • End-to-end: foyer-bench --file (uses FileDeviceBuilder::build) for both psync and io_uring engines no longer emits the library debug marker.
  • Routine checks pass: cargo check, cargo fmt --check (stable + nightly configs), cargo clippy for foyer-storage and the umbrella foyer crate (incl. serde/tracing/clap/deadlock/tokio-console feature combos), the full foyer-storage and foyer test suites, doctests, and the 8 repo examples via cargo x --fast.
  • Repo grep confirms no println!/print!/eprintln! remains in foyer-storage/src/io/device/file.rs.

The repo's license-eye header check and cargo sort --check gates fail on the pristine baseline too (tool/config mismatch affecting 117 files and all workspace manifests), independent of this one-line deletion; this change touches neither a manifest nor any file's license header.


Automatic Fixes PRs can be configured here.

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.

0 participants