Skip to content

Fall back to NIO instead of throwing when no native transport is available#2209

Merged
hyperxpro merged 2 commits into
mainfrom
native-transport-nio-fallback
Jun 21, 2026
Merged

Fall back to NIO instead of throwing when no native transport is available#2209
hyperxpro merged 2 commits into
mainfrom
native-transport-nio-fallback

Conversation

@hyperxpro

Copy link
Copy Markdown
Member

Motivation:

When useNativeTransport=true but no native transport can be loaded (Windows, a minimal image, or missing/failed native libs), getNativeTransportFactory threw IllegalArgumentException and hard-failed client construction.

Modification:

Fall back to the always-available NIO transport in that case, logging once at WARN, instead of throwing. The shipped default (useNativeTransport=false) and the config-time useOnlyEpollNativeTransport validation are unchanged.

Result:

Requesting native transport never fails client construction; native is still selected when available, and absence degrades gracefully to NIO. Verified both paths on JDK 11 (native present, and forced off via -Dio.netty.transport.noNative=true).

@hyperxpro hyperxpro merged commit fa4de48 into main Jun 21, 2026
17 checks passed
@hyperxpro hyperxpro deleted the native-transport-nio-fallback branch June 21, 2026 20:20
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.

1 participant