GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Wrap ECONNREFUSED in PortUnreachableException for UDP (#16131) by normanmaurer · Pull Request #16150 · netty/netty Conversation
Member
Motivation: Currently,
In Modifications:
Result: Improved behavioural parity between Co-authored-by: Norman Maurer [email protected]
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsMotivation:
Currently, `KQueueDatagramChannel` handles `ECONNREFUSED` inconsistently
depending on how data is sent:
- `sendToAddress()` (Unconnected): Correctly wraps errors in
`PortUnreachableException`.
- `writeAddress()` (Connected): Returns raw `ECONNREFUSED`, causing an
inconsistency with `NIO` behaviour.
In `NIO`, the exception is thrown from the write path:
```
java.net.PortUnreachableException
at java.base/sun.nio.ch.DatagramDispatcher.write0(Native Method)
at java.base/sun.nio.ch.DatagramDispatcher.write(DatagramDispatcher.java:51)
at java.base/sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:137)
at java.base/sun.nio.ch.IOUtil.write(IOUtil.java:81)
at java.base/sun.nio.ch.IOUtil.write(IOUtil.java:58)
at java.base/sun.nio.ch.DatagramChannelImpl.write(DatagramChannelImpl.java:1160)
at io.netty.channel.socket.nio.NioDatagramChannel.doWriteMessage(NioDatagramChannel.java:309)
```
Modifications:
- Introduced `translateForConnected()` to handle error mapping
specifically for the connected state.
- Updated `doWriteMessage()` to apply this translation when the channel
is connected (`remoteAddress == null`) and `writeAddress()` fails with
`ECONNREFUSED`.
Result:
Improved behavioural parity between `KQueue` and `NIO` transports. Users
will now receive a consistent `PortUnreachableException` regardless of
the send path used.
---------
Co-authored-by: Norman Maurer <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |