Repository navigation
Align native transport option selection with default order - #3818
Merged
a-TODO-rov merged 3 commits intoJul 6, 2026
Merged
Conversation
Fixes redis#3816. ExtendedKeepAliveSupport and ConnectionBuilder checked io_uring before epoll when applying extended keep-alive and TCP_USER_TIMEOUT options, while Transports.NativeTransports builds the channel/event loop with Epoll prioritized over io_uring. When both native transports are on the classpath, this mismatch caused io_uring-specific ChannelOptions to be applied to an epoll-backed bootstrap, triggering Netty warnings and skipping the real keep-alive config. Reorders both checks to Epoll > IOUring, matching the existing priority used by Transports.NativeTransports and DefaultEventLoopGroupProvider. Signed-off-by: Karun Choudhary <karunchoudhary2000@gmail.com>
This reverts commit 8eed573.
Collaborator
|
Hey @karunsehwag |
a-TODO-rov
added a commit
that referenced
this pull request
Jul 13, 2026
* Align native transport option selection with default order Fixes #3816. ExtendedKeepAliveSupport and ConnectionBuilder checked io_uring before epoll when applying extended keep-alive and TCP_USER_TIMEOUT options, while Transports.NativeTransports builds the channel/event loop with Epoll prioritized over io_uring. When both native transports are on the classpath, this mismatch caused io_uring-specific ChannelOptions to be applied to an epoll-backed bootstrap, triggering Netty warnings and skipping the real keep-alive config. Reorders both checks to Epoll > IOUring, matching the existing priority used by Transports.NativeTransports and DefaultEventLoopGroupProvider. Signed-off-by: Karun Choudhary <karunchoudhary2000@gmail.com> --------- Signed-off-by: Karun Choudhary <karunchoudhary2000@gmail.com> Co-authored-by: aleksandar.todorov <a_t_todorov@yahoo.com>
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.
Transports.NativeTransportsprefers native transports in the order:Epoll > Kqueue > IOUringHowever,
ExtendedKeepAliveSupportand the TCP_USER_TIMEOUT handling inConnectionBuilderchecked io_uring availability before epoll. When both epoll and io_uring are present on the classpath, Lettuce can create an epoll-backed channel while these option paths attempt to apply io_uring-specific channel options.That can result in unknown channel option warnings and prevents the epoll keep-alive / TCP_USER_TIMEOUT options from being applied consistently.
This change aligns those option-selection paths with the existing native transport priority order by checking epoll before io_uring.
The fix is intentionally small. A broader refactor to centralize the priority order can be handled separately if maintainers prefer.
Fixes #3816
Note
Low Risk
Small, localized change to transport option selection order on Linux; no API or auth changes.
Overview
When both epoll and io_uring are on the classpath, Lettuce builds channels with epoll (
Transports.NativeTransports: Epoll > Kqueue > IOUring), but TCP_USER_TIMEOUT inConnectionBuilderand extended keep-alive inExtendedKeepAliveSupportstill preferred io_uring first. That mismatch could apply transport-specific options to the wrong bootstrap and trigger unknown channel option warnings.This PR checks epoll before io_uring in those code paths and documents that the order must match channel/event-loop selection. The static
EXTENDED_KEEPALIVE_SUPPORTEDflag uses the same epoll-then-io_uring ordering for consistency.Reviewed by Cursor Bugbot for commit d62a2f6. Bugbot is set up for automated code reviews on this repo. Configure here.