Skip to content

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

@atharvalade

Description

@atharvalade

When loading consumer offsets at startup, the server panics if any file in the consumer offset directory has a non-numeric filename.

File: core/server/src/streaming/partitions/storage.rs lines 183-186, 247-252

let name = dir_entry.file_name().into_string().unwrap();
let consumer_id = name.parse::<u32>().unwrap_or_else(|_| {
    panic!("Invalid consumer ID file with name: '{}'.", name);
});

An operator accidentally placing a file (e.g. .DS_Store, editor swap file, backup) in the consumer offsets directory crashes the server on startup. This should be a warning + skip, not a panic.

I think we should log a warning and skip non-numeric filenames instead of panicking.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions