Auto-detect native transport by default when its library is available - #2216
Open
hyperxpro wants to merge 5 commits into
Open
Auto-detect native transport by default when its library is available#2216hyperxpro wants to merge 5 commits into
hyperxpro wants to merge 5 commits into
Conversation
hyperxpro
force-pushed
the
native-transport-auto-detect
branch
5 times, most recently
from
August 2, 2026 13:57
665b215 to
4a85394
Compare
hyperxpro
added a commit
that referenced
this pull request
Aug 2, 2026
… io_uring fallback Fixes for PR #2216 CI failures on io_uring: - InputStreamMultipartPart: prevent infinite loop with slowTarget backpressure - StackTraceInspector: detect native transport connection resets via errno matching - NettyChannelConnector: annotate connect failures with host:port for io_uring - ChannelManager: fallback from io_uring to epoll on ring allocation failure (io_uring rings charge against RLIMIT_MEMLOCK, not always available) Rebased on #2288 (Fix per-host connection permit leak) for proper semaphore handling.
hyperxpro
added a commit
that referenced
this pull request
Aug 2, 2026
… io_uring fallback Fixes for PR #2216 CI failures on io_uring: - InputStreamMultipartPart: prevent infinite loop with slowTarget backpressure - StackTraceInspector: detect native transport connection resets via errno matching - NettyChannelConnector: annotate connect failures with host:port for io_uring - ChannelManager: fallback from io_uring to epoll on ring allocation failure (io_uring rings charge against RLIMIT_MEMLOCK, not always available) Rebased on #2288 (Fix per-host connection permit leak) for proper semaphore handling.
hyperxpro
force-pushed
the
native-transport-auto-detect
branch
from
August 2, 2026 14:00
4a85394 to
a6b7357
Compare
hyperxpro
added a commit
that referenced
this pull request
Aug 2, 2026
… io_uring fallback Fixes for PR #2216 CI failures on io_uring: - InputStreamMultipartPart: prevent infinite loop with slowTarget backpressure - StackTraceInspector: detect native transport connection resets via errno matching - NettyChannelConnector: annotate connect failures with host:port for io_uring - ChannelManager: fallback from io_uring to epoll on ring allocation failure (io_uring rings charge against RLIMIT_MEMLOCK, not always available) Rebased on #2288 (Fix per-host connection permit leak) for proper semaphore handling.
hyperxpro
force-pushed
the
native-transport-auto-detect
branch
from
August 2, 2026 14:04
a6b7357 to
d223fcb
Compare
… io_uring fallback Fixes for PR #2216 CI failures on io_uring: - InputStreamMultipartPart: prevent infinite loop with slowTarget backpressure - StackTraceInspector: detect native transport connection resets via errno matching - NettyChannelConnector: annotate connect failures with host:port for io_uring - ChannelManager: fallback from io_uring to epoll on ring allocation failure (io_uring rings charge against RLIMIT_MEMLOCK, not always available) Rebased on #2288 (Fix per-host connection permit leak) for proper semaphore handling.
hyperxpro
force-pushed
the
native-transport-auto-detect
branch
from
August 2, 2026 15:21
d223fcb to
0e31b49
Compare
C1: InputStreamMultipartPart - restore position check to prevent hang on
streams that don't EOF after declared length (socket-backed, etc)
C2: annotateConnectException - preserve ConnectException type to avoid
breaking retry predicates that key on ClosedChannelException or
SslHandler.disconnect stack frames
hyperxpro
force-pushed
the
native-transport-auto-detect
branch
from
August 2, 2026 18:17
1181c12 to
c9326b5
Compare
The existing zero-copy test drains every write, so nothing exercised the path io_uring takes when its staging buffer fills. Adds a bounded channel that returns 0 until the caller yields, which is what #2216 spun on. Catches a second bug it turned up: the part still read once past the declared length, so a socket-backed stream would block there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation:
AHC defaulted to NIO and only used epoll/io_uring when an app explicitly called setUseNativeTransport(true), so Linux apps that had the native library on the classpath but didn't set the flag silently ran on the slower NIO transport.
Modification:
When neither useNativeTransport nor a custom EventLoopGroup is set, auto-select a native transport (io_uring/epoll on Linux, kqueue on macOS) if its library is present, otherwise NIO, with no warning. The explicit setUseNativeTransport(true) path keeps A4's warn-and-fallback. Force NIO with
-Dio.netty.transport.noNative=true.Result:
Native transport is used out of the box wherever its library is available.