lettuce icon indicating copy to clipboard operation
lettuce copied to clipboard

Using non-native transports with SocketOptions should cause an error

Open thachlp opened this issue 8 months ago • 2 comments

Isssue #3251

  • [x] You have read the contribution guidelines.
  • [x] You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • [x] 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.

thachlp avatar Apr 26 '25 11:04 thachlp

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?

tishun avatar May 09 '25 15:05 tishun

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.

thachlp avatar May 19 '25 04:05 thachlp