Skip to content

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

Open
zoewangg wants to merge 1 commit intomasterfrom
zoewang/betterTimeoutExceptionsNetty
Open

Include channel diagnostics in Read/Write timeout error messages in n…#6839
zoewangg wants to merge 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

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.

2 participants