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 by violetagg · Pull Request #16131 · netty/netty Conversation
Member
Motivation: Currently,
In Modifications:
Result: Improved behavioural parity between
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
normanmaurer
requested changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one nit
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
normanmaurer
requested changes
Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Motivation:
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.
…/KQueueDatagramChannel.java Co-authored-by: Norman Maurer <[email protected]> Before the fix the exception below is thrown "io.netty.channel.unix.Errors$NativeIoException: io_uring sendmsg(..) failed with error(-111): Connection refused" After the fix the exception is wrapped " java.net.PortUnreachableException: io_uring sendmsg(..) failed with error(-111): Connection refused at io.netty.channel.uring.IoUringDatagramChannel.translateForConnected(IoUringDatagramChannel.java:654) at io.netty.channel.uring.IoUringDatagramChannel.access$400(IoUringDatagramChannel.java:54) at io.netty.channel.uring.IoUringDatagramChannel$IoUringDatagramChannelUnsafe.removeFromOutboundBuffer(IoUringDatagramChannel.java:571) at io.netty.channel.uring.IoUringDatagramChannel$IoUringDatagramChannelUnsafe.writeComplete0(IoUringDatagramChannel.java:551) at io.netty.channel.uring.AbstractIoUringChannel$AbstractUringUnsafe.writeComplete(AbstractIoUringChannel.java:976) at io.netty.channel.uring.AbstractIoUringChannel$AbstractUringUnsafe.handle(AbstractIoUringChannel.java:470) at io.netty.channel.uring.IoUringIoHandler$DefaultIoUringIoRegistration.handle(IoUringIoHandler.java:598) at io.netty.channel.uring.IoUringIoHandler.handle(IoUringIoHandler.java:288) at io.netty.channel.uring.CompletionQueue.process(CompletionQueue.java:149) at io.netty.channel.uring.IoUringIoHandler.processCompletionsAndHandleOverflow(IoUringIoHandler.java:197) at io.netty.channel.uring.IoUringIoHandler.run(IoUringIoHandler.java:186) at io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:225) at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:196) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1195) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:1474) Caused by: io.netty.channel.unix.Errors$NativeIoException: io_uring sendmsg(..) failed with error(-111): Connection refused "
violetagg
force-pushed
the
udp-write-address
branch
from
befafea to
6756f24
Compare
Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
normanmaurer
added a commit
that referenced
this pull request
Motivation:
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]>
normanmaurer
added a commit
that referenced
this pull request
Motivation:
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]>
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
normanmaurer
added a commit
that referenced
this pull request
Motivation:
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]>
---------
Co-authored-by: Violeta Georgieva <[email protected]>
normanmaurer
added a commit
that referenced
this pull request
Motivation:
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]>
---------
Co-authored-by: Violeta Georgieva <[email protected]>
Closed
Closed
This was referenced
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh 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. |