Skip to content

fix(server): warn and skip non-numeric filenames in consumer offset directories instead of panicking#3135

Open
atharvalade wants to merge 1 commit intoapache:masterfrom
atharvalade:fix/panic-on-non-numeric-consumer-offset-filenames
Open

fix(server): warn and skip non-numeric filenames in consumer offset directories instead of panicking#3135
atharvalade wants to merge 1 commit intoapache:masterfrom
atharvalade:fix/panic-on-non-numeric-consumer-offset-filenames

Conversation

@atharvalade
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #3132

Rationale

An operator accidentally placing a file (e.g. .DS_Store, editor swap file, backup) in the consumer offsets directory crashes the server on startup due to a panic! on non-numeric filenames.

What changed?

Both load_consumer_offsets and load_consumer_group_offsets in core/server/src/streaming/partitions/storage.rs panicked when encountering files with non-numeric names during startup offset loading.

The fix replaces both panic! calls with warn! log messages and continue, so the server gracefully skips unexpected files. Added 9 unit tests covering valid files, non-numeric files (.DS_Store, backup.bak), empty directories, subdirectories, and nonexistent paths for both functions.

Local Execution

  • Passed
  • Pre-commit hooks ran

AI Usage

  1. Opus 4.6
  2. Minimal AI used
  3. All tests verified locally with cargo test, cargo clippy, cargo fmt --check, and CI scripts
  4. Yes, all code can be explained

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.16%. Comparing base (f5350d9) to head (4fc2476).

Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3135       +/-   ##
=============================================
- Coverage     72.76%   55.16%   -17.60%     
  Complexity      943      943               
=============================================
  Files          1117     1115        -2     
  Lines         96368    86104    -10264     
  Branches      73544    63295    -10249     
=============================================
- Hits          70119    47503    -22616     
- Misses        23702    36043    +12341     
- Partials       2547     2558       +11     
Components Coverage Δ
Rust Core 49.36% <100.00%> (-24.13%) ⬇️
Java SDK 62.30% <ø> (ø)
C# SDK 69.11% <ø> (-0.31%) ⬇️
Python SDK 81.43% <ø> (ø)
Node SDK 91.44% <ø> (-0.10%) ⬇️
Go SDK 39.41% <ø> (ø)
Files with missing lines Coverage Δ
core/server/src/streaming/partitions/storage.rs 71.50% <100.00%> (+4.83%) ⬆️

... and 233 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

server: panic on non-numeric filenames in consumer offset directories

1 participant