-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket.isIPv6Preferred()
may return an incorrect value
#10909
Milestone
Comments
Possible workarounds for this issue at the moment are:
I'm currently using the second workaround because Armeria currently tries to detect all available native transports upfront. |
trustin
added a commit
to trustin/armeria
that referenced
this issue
Jan 4, 2021
…ive library Motivation: Since 4edffc8, we check whether epoll and io_uring native transports are available or not upfront. However, there's a known issue in Netty where `Socket.isIPv6Preferred()` can return a wrong value when more than one native transport are loaded: - netty/netty#10909 Modifications: - Force-reinitialize `Socket` by calling its private method after a new native library is loaded, so that `Socket.isIPv6Preferred()` always returns a correct value. Result: - We don't get the 'Address family not supported by protocol' or 'Connection refused' error anymore. - Works around netty/netty#10909 until it's fixed.
Fixed by netty/netty-incubator-transport-io_uring#31 and #10876 |
Oh, that's awesome 😄 |
I found I can actually reproduce this problem with 4.1.58 and 0.0.3 🤔 |
Please open a new issue and a reproducer :) |
trustin
added a commit
to trustin/armeria
that referenced
this issue
Mar 30, 2021
Since 4edffc8, we check whether epoll and io_uring native transports are available or not upfront. However, there's a known issue in Netty where `Socket.isIPv6Preferred()` can return a wrong value when more than one native transport are loaded: - netty/netty#10909 Modifications: - Force-reinitialize `Socket` by calling its private method after a new native library is loaded, so that `Socket.isIPv6Preferred()` always returns a correct value. Result: - We don't get the 'Address family not supported by protocol' or 'Connection refused' error anymore. - Works around netty/netty#10909 until it's fixed.
trustin
added a commit
to trustin/armeria
that referenced
this issue
Mar 30, 2021
…ive library Motivation: Since 4edffc8, we check whether epoll and io_uring native transports are available or not upfront. However, there's a known issue in Netty where `Socket.isIPv6Preferred()` can return a wrong value when more than one native transport are loaded: - netty/netty#10909 Modifications: - Force-reinitialize `Socket` by calling its private method after a new native library is loaded, so that `Socket.isIPv6Preferred()` always returns a correct value. Result: - We don't get the 'Address family not supported by protocol' or 'Connection refused' error anymore. - Works around netty/netty#10909 until it's fixed.
trustin
added a commit
to line/armeria
that referenced
this issue
Mar 31, 2021
…e library (#3425) Motivation: Since 4edffc8, we check whether epoll and io_uring native transports are available or not upfront. However, there's a known issue in Netty where `Socket.isIPv6Preferred()` can return a wrong value when more than one native transport are loaded: - netty/netty#10909 Modifications: - Force-reinitialize `Socket` by calling its private method after a new native library is loaded, so that `Socket.isIPv6Preferred()` always returns a correct value. Result: - We don't get the 'Address family not supported by protocol' or 'Connection refused' error anymore. - Works around netty/netty#10909 until it's fixed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
io.netty.channel.unix.Socket.isIPv6Preferred()
returnstrue
on a Linux system with IPv6 support, even if a user attempted to initialize io_uring support.Actual behavior
false
is returned even on a Linux system with IPv6 support when bothEpoll
andIOUring
are loaded.It seems like the secondly loaded library 'reverts' the initialization performed by the firstly loaded library when it's loaded.
Native
class of the both libraries attempt to callSocket.initialize()
, but the second call will not have any effect because of an initialization check.We could solve this problem either by:
Socket
dynamically like we do for epoll and io_uring; orSocket
Steps to reproduce
On Linux kernel without io_uring support (5.4.85 in my case),
Epoll
, which succeeds.Socket.isIPv6Preferred()
returnstrue
, which should.IOUring
, which fails due to a 'failed to allocate a ring buffer' error.Socket.isIPv6Preferred()
suddenly starts to returnfalse
.Minimal yet complete reproducer code (or URL to code)
Netty version
4.1.54
JVM version (e.g.
java -version
)OS version (e.g.
uname -a
)The text was updated successfully, but these errors were encountered: