Skip to content

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

@tishun

Description

@tishun

Feature Request

Is your feature request related to a problem? Please describe

Introduced in Lettuce 6.1 (and then extended in the following releases) the SocketOptions is used to set up TCP socket options.
These could be used to configure TCP_USER_TIMEOUT and KEEP_ALIVE options as part of the ClientOptions

These can only be applied when using native transports such as io_uring, epoll or kqueue. When the default NIO transport is used the driver will output a warning message in the logs of the application.

However this has proven to be hidden from the users and their expectations for the logic to work were not met. In production environments it is not easy to debug if native transports are used or not, because they are dynamically loaded in runtime and in some cases they might be missing even if they are part of the configuration.

Since the user has clearly stated they want this option enabled we should fail if we are unable to apply it, instead of ignore it.

Describe the solution you'd like

Throw an exception and stop the driver from continuing if the settings could not be applied.

Since this is a change of behavior this should only be considered in major releases.

Describe alternatives you've considered

Similarly to #3249 and #3250 educating the users has not proven to be of much help.

Teachability, Documentation, Adoption, Migration Strategy

Existing users who want to continue loading the driver without native transports must not configure the socket options.
They would not be applied anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions