Skip to content

Using non-native transports with SocketOptions should cause an error#3279

Merged
tishun merged 2 commits intoredis:mainfrom
thachlp:thrown-error-when-using-non-native-transport
Aug 8, 2025
Merged

Using non-native transports with SocketOptions should cause an error#3279
tishun merged 2 commits intoredis:mainfrom
thachlp:thrown-error-when-using-non-native-transport

Conversation

@thachlp
Copy link
Copy Markdown
Contributor

@thachlp thachlp commented Apr 26, 2025

Isssue #3251

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

@tishun tishun added this to the 7.0.0.RELEASE milestone May 9, 2025
@tishun
Copy link
Copy Markdown
Collaborator

tishun commented May 9, 2025

This is an interesting approach, but it does not fully cover the different invariants.

The logic that outputs warnings in the log is in the ConnectionBuilder.java class.

As you can see only io_uring and epoll support TCP_USER_TIMOUT, while io_uring, epoll the extended socket options in Java 11 support TCP_KEEP_ALIVE / TCP_KEEPIDLE and TCP_KEEPINTERVAL.

I was thinking of replacing the log message with the LettuceAssert.assertState that is already used there.

What do you think?

@thachlp
Copy link
Copy Markdown
Contributor Author

thachlp commented May 19, 2025

This is an interesting approach, but it does not fully cover the different invariants.

The logic that outputs warnings in the log is in the ConnectionBuilder.java class.

As you can see only io_uring and epoll support TCP_USER_TIMOUT, while io_uring, epoll the extended socket options in Java 11 support TCP_KEEP_ALIVE / TCP_KEEPIDLE and TCP_KEEPINTERVAL.

I was thinking of replacing the log message with the LettuceAssert.assertState that is already used there.

What do you think?

I agree; this is the safer version. I don't want to break anything. Let me update.

Revert previous implement
Copy link
Copy Markdown
Collaborator

@tishun tishun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

We will leave this until we are ready to start work on 7.0

@tishun tishun merged commit 4322b4f into redis:main Aug 8, 2025
7 checks passed
@ggivo ggivo added the type: improvement An improvement to the existing implementation label Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: improvement An improvement to the existing implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants