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

How to set timeout on a redis cluster client #128

Open
yyhclimacool opened this issue Nov 25, 2019 · 4 comments
Open

How to set timeout on a redis cluster client #128

yyhclimacool opened this issue Nov 25, 2019 · 4 comments

Comments

@yyhclimacool
Copy link

hiredis-vip : master
date : 2019-11-25
hiredis version in hircluster.h : 1.0.0

In my code, I got a redisClusterContext,
I called
struct timeval tv = { _timeout_ms / 1000, (_timeout_ms % 1000) * 1000};
_context = redisClusterConnectWithTimeout(_host.c_str(), tv, HIRCLUSTER_FLAG_NULL);
if (redisClusterSetOptionTimeout(_context,tv) != REDIS_OK) { /* log on error */ }

Why it won't work, if I set _timeout_ms=10 , my redis command timer still get a number bigger than 10, say 29 maybe...

@sdouek
Copy link

sdouek commented May 6, 2020

Also happen to me:
Doesn't timeout properly when server is unreachable.
when you will fix it ?

1 similar comment
@wangfuqiang
Copy link

Also happen to me:
Doesn't timeout properly when server is unreachable.
when you will fix it ?

@wangfuqiang
Copy link

Also happen to me: Doesn't timeout properly when server is unreachable. when you will fix it ?

how do you solve this pro?

@wangfuqiang
Copy link

hiredis-vip : master date : 2019-11-25 hiredis version in hircluster.h : 1.0.0

In my code, I got a redisClusterContext, I called struct timeval tv = { _timeout_ms / 1000, (_timeout_ms % 1000) * 1000}; _context = redisClusterConnectWithTimeout(_host.c_str(), tv, HIRCLUSTER_FLAG_NULL); if (redisClusterSetOptionTimeout(_context,tv) != REDIS_OK) { /* log on error */ }

Why it won't work, if I set _timeout_ms=10 , my redis command timer still get a number bigger than 10, say 29 maybe...

how do you solve this pro?

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