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
Conversation
…irectories instead of panicking
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 apanic!on non-numeric filenames.What changed?
Both
load_consumer_offsetsandload_consumer_group_offsetsincore/server/src/streaming/partitions/storage.rspanicked when encountering files with non-numeric names during startup offset loading.The fix replaces both
panic!calls withwarn!log messages andcontinue, 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
AI Usage
cargo test,cargo clippy,cargo fmt --check, and CI scripts