Skip to content

redis application level keep alive #2256

Closed as not planned
Closed as not planned

Description

@chenjuq126

Feature Request

Lettuce cannot recover from connection problems. The problem is fixed.

My condition differs from it a little: a socks proxy add between client and redis.
lettuce <--> socks proxy A <--> redis server
lettuce <--> socks proxy B <--> redis server

Is there any application feature for client to detect server alive or reachable? Because, SocketOptions and EpollChannelOption.TCP_KEEPINTVL works on TCP layer.
1 if there is a TCP socks proxy between lettuce and redis server;
2 the TCP keep-alive data packet can not be transferred to redis server;
3 if socks proxy A can not reach redis server temporary eg. 20 minutes.
on the 3 items above, clients connected with A can not know whether the server is reachable in a short time, if only depends on TCP keep-alive. setget, pubsub, and lock can not work.

Is your feature request related to a problem? Please describe

A clear and concise description of what the problem is. Ex. I have an issue when [...]

Describe the solution you'd like

Application level keep alive configuration.

A clear and concise description of what you want to happen. Add any considered drawbacks.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Teachability, Documentation, Adoption, Migration Strategy

If you can, explain how users will be able to use this and possibly write out a version the docs.
Maybe a screenshot or design?

Activity

  1. mp911de commented on Nov 21, 2022

    @mp911de
    Collaborator

    if socks proxy A can not reach redis server temporary eg. 20 minutes.

    Then your proxy server should disconnect the connection. Otherwise, we're trying to work around a very specific scenario.

  2. neioWHU commented on Nov 21, 2022

    @neioWHU

    Can lettuce consider introducing the testonborrow mechanism?

  3. mp911de commented on Nov 21, 2022

    @mp911de
    Collaborator

    ConnectionPoolSupport is a very thin layer on top of Apache Commons Pool 2. The object validation uses a check based on whether the socket is connected. If we would use e.g. PING and a blocking command is ongoing, we would easily cause a situation where validation isn't working for everyone.

    You can easily provide such a wrapper in your own code.

  4. tishun commented on Feb 14, 2025

    @tishun
    Collaborator

    See #3177 for a possible solution using NettyCustomizer

  5. github-actions commented on Mar 17, 2025

    @github-actions

    If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 2 weeks this issue will be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: feedback-reminderWe've sent a reminder that we need additional information before we can continuestatus: waiting-for-feedbackWe need additional information before we can continue

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions