fix(buffers): treat I/O errors as recoverable to prevent panics #24524
+22
−7
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.
Summary
This PR fixes a panic in the disk buffer that crashes the entire Vector process when encountering I/O errors (such as missing buffer files).
The Problem:
When the disk buffer reader encounters I/O errors like
NotFound(file missing), it panics atreceiver.rs:59with:This panic crashes Vector completely, stopping all pipelines across all components.
The Solution:
Treat I/O errors the same way we already treat corruption/checksum errors - emit an error event, log it, update metrics, and skip to the next buffer file. The disk buffer reader already has
roll_to_next_data_file()logic that handles advancing past problematic files, so we simply remove the panic and emit aBufferReadErrorinstead.Behavior Change:
Events in the corrupted/missing file are lost (same as corruption handling today). Users can monitor via
buffer_errors_total{error_code="io_error"}metric.Vector configuration
No specific configuration needed for testing. The fix applies to any Vector configuration using disk buffers:
How did you test this PR?
--test-threads=1due to pre-existing test isolation issue)cargo clippy --package vector-buffers -- -D warningscargo fmt --checkChange Type
Is this a breaking change?
Does this PR include user facing changes?
changelog.d/disk-buffer-io-error-panic.fix.mdReferences