Skip to content

Replace IllegalStateException with EOFException in readRawVarint32#2687

Merged
jaydeluca merged 2 commits intoopen-telemetry:mainfrom
OxxxyAction:improvement/disk-buffering-error-handling
Mar 12, 2026
Merged

Replace IllegalStateException with EOFException in readRawVarint32#2687
jaydeluca merged 2 commits intoopen-telemetry:mainfrom
OxxxyAction:improvement/disk-buffering-error-handling

Conversation

@OxxxyAction
Copy link
Contributor

Replace unchecked IllegalStateException with checked EOFException and IOException
Enables graceful handling of corrupted disk-buffered data
Fixes #2684

Description:

Replaces unchecked IllegalStateException with checked EOFException to enable graceful error handling for corrupted disk-buffered data.

Existing Issue(s):

#2684

@OxxxyAction OxxxyAction requested a review from a team as a code owner March 12, 2026 09:52
Copilot AI review requested due to automatic review settings March 12, 2026 09:52
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 12, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replace unchecked IllegalStateException throws in readRawVarint32 with checked EOFException/IOException so callers can gracefully handle truncated or corrupted disk-buffered protobuf data (fixes #2684).

Changes:

  • Throw EOFException when the stream ends mid-varint (read() returns -1).
  • Throw IOException instead of IllegalStateException when the varint is malformed/too long.

You can also share your feedback on Copilot code review. Take the survey.

- Replace unchecked IllegalStateException with checked EOFException and IOException
- Enables graceful handling of corrupted disk-buffered data

Fixes open-telemetry#2684
@OxxxyAction OxxxyAction force-pushed the improvement/disk-buffering-error-handling branch from b82fabd to 64bce13 Compare March 12, 2026 10:34
Copy link
Contributor

@LikeTheSalad LikeTheSalad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @OxxxyAction

I agree with Copilot's comments on adding error messages to the exceptions. Other than that, it looks good to me 👍

@jaydeluca jaydeluca added this pull request to the merge queue Mar 12, 2026
Merged via the queue into open-telemetry:main with commit 0834da3 Mar 12, 2026
21 checks passed
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.

Replace IllegalStateException with EOFException in ProtobufTools.readRawVarint32 to enable graceful error handling

4 participants