Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis application level keep alive #2256

Open
chenjuq126 opened this issue Nov 21, 2022 · 3 comments
Open

redis application level keep alive #2256

chenjuq126 opened this issue Nov 21, 2022 · 3 comments

Comments

@chenjuq126
Copy link

chenjuq126 commented Nov 21, 2022

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?

@mp911de
Copy link
Collaborator

mp911de commented Nov 21, 2022

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.

@neioWHU
Copy link

neioWHU commented Nov 21, 2022

Can lettuce consider introducing the testonborrow mechanism?

@mp911de
Copy link
Collaborator

mp911de commented Nov 21, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants