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

Why Jedis uses setTimeoutInfinite when it runs eval&evalSha command? #2027

Closed
pavel-hp opened this issue Jul 19, 2019 · 2 comments · Fixed by #2028
Closed

Why Jedis uses setTimeoutInfinite when it runs eval&evalSha command? #2027

pavel-hp opened this issue Jul 19, 2019 · 2 comments · Fixed by #2028

Comments

@pavel-hp
Copy link

Could you please explain why Jedis uses setTimeoutInfinite (socket.setSoTimeout(0);) when it runs eval&evalSha command?
https://github.com/xetorthio/jedis/blob/c9c118aa86a1ff473b94dddd7fb28d640837e194/src/main/java/redis/clients/jedis/BinaryJedis.java#L3317

I faced with an issue when thread just stuck here..

@sazzad16
Copy link
Collaborator

@pavel-hp There could be many Redis operations in one EVAL command. I think, because of this reason, the author thought setting timeout to infinite is a better approach.

@pavel-hp
Copy link
Author

pavel-hp commented Jul 20, 2019

Hello @sazzad16 !
Let me explain why it is a problem.
We faced with this issue when we did resilience and failover tests with Redis.
Our application must be able to gracefully shutdown in case of unresolvable problem. But in this case we cannot close Application in proper way, because threads were in RUNNING state and application has to wait for unfinished jobs.

Yes for sure, there could be many Redis operations in LUA script but what is the point to have Infinite timeout on socket read? We still talking about Redis which is memory database and should be fast. If operation not performed let say during one minute it has to be timeouted for sure.

I think user should have ability to control this parameter (eval & evalSHA related). By default it could have let say 30 seconds value (or even less) but not Infinite for sure!

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

Successfully merging a pull request may close this issue.

2 participants