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

Intoroduce command timeout #293

Open
pendula95 opened this issue May 26, 2021 · 1 comment
Open

Intoroduce command timeout #293

pendula95 opened this issue May 26, 2021 · 1 comment

Comments

@pendula95
Copy link
Member

Describe the feature

While using the redis client there might be cases where sent Commands will hang because of the network issue or load issue on Redis server. In this cases sent commands will be left hanging without any response. Example is failover when redis cluster nodes will stop responding as no exception will be thrown. For this cases it would be good to introduce option to set command timeout directly via API.

I have been able to achieve this by using javarx timeout but without javarx I am not sure how I would do this with futures and promises. There does not seem to be an option. eclipse-vertx/vert.x#3307

Also I am not sure what happens to sent commands that get timedout by javarx, are they canceled on the context and are there any hidden implications?

Use cases

Better failover/reconnect handling.
Better control over request/response time.

Contribution

The feature does not seem to complicated to implement. With some discussion and plan I think I would to submit PR.

@pmlopes
Copy link
Member

pmlopes commented Jul 27, 2021

One way to address this is to use:

CONFIG SET timeout 30

Add idle connections will close after 30s of idling. This is what other libraries like jedis do when you configure the timeout in the client.

The thing is that this config is per server, not connection so it needs to be used carefully.

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

No branches or pull requests

2 participants