Skip to content

Include channel diagnostics in Read/Write timeout error messages in n…#6839

Merged
zoewangg merged 1 commit intomasterfrom
zoewang/betterTimeoutExceptionsNetty
Apr 6, 2026
Merged

Include channel diagnostics in Read/Write timeout error messages in n…#6839
zoewangg merged 1 commit intomasterfrom
zoewang/betterTimeoutExceptionsNetty

Conversation

@zoewangg
Copy link
Copy Markdown
Contributor

@zoewangg zoewangg commented Apr 3, 2026

Motivation and Context

Read and write timeout errors from the Netty client previously only included a plain message like "Read timed out" or "Write timed out" without any channel context. In contrast, ClosedChannelException and connection reset errors already included channel diagnostics. This made debugging timeout issues harder since there was no visibility into channel state at the time of failure.

Modifications

  • Generalized closedChannelMessage into errorMessageWithChannelDiagnostics that accepts a custom message parameter
  • Updated decorateException to include channel diagnostics for ReadTimeoutException and WriteTimeoutException
  • Retained closedChannelMessage as a delegate for existing callers
  • Refactored else if chain to separate if blocks for readability
  • Consolidated decorateException tests using parameterized tests

Testing

  • Added parameterized tests verifying channel diagnostics are included in Read/Write timeout error messages
  • Added tests for errorMessageWithChannelDiagnostics with null channel and with diagnostics present
  • Existing tests refactored into parameterized form covering all wrapping and passthrough cases

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn clean install -pl :netty-nio-client succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@zoewangg zoewangg requested a review from a team as a code owner April 3, 2026 23:09
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 3, 2026

@zoewangg zoewangg added this pull request to the merge queue Apr 6, 2026
Merged via the queue into master with commit 271041c Apr 6, 2026
39 of 41 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants