-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Using setOption on redis array causes immediate connection #504
Comments
Hi there, I don't know if it's related but i just created a multiple shard Redis Array cluster setting Any hints about this? |
Thanks for the reports guys, I'll look into this for you. I'll commit any fix into develop and then it'll come out in a future release for things like PECL. Cheers! |
Hi, could you investigate what causes RedisArray to connect to all servers even with lazyness activated? Thanks! |
The reason it's connecting is that methods like |
Some methods don't need to automatically connect to Redis if called either with a standard Redis object or from the context of a RedisArray object. This includes stuff like getOption(), setOption(), etc which don't actually need to connect as they don't need anything over the wire. Addresses #504
Can you please try the branch Cheers! |
I'll try tomorrow and will report results, thanks! |
Hi, I cloned the project, did checkout of the
Doing a
As far as i understand there shouldn't be any output in this Thanks! |
Hey, I'll try to replicate your issue using the tools you are. Honestly the way I did it was to spin up a redis array and simply going to the redis server in question and doing a You're testing at a lower level though so I'll look into it. Cheers, |
That's very interesting indeed. I didn't check |
re-triggering this thread, any indication when the lazy branch will make it into the stable extension? It's a big deal! |
@bryanlatten, could you test fix from PR #1032? |
$servers = ["validserver:6379", "invaliddnsname:6379"];
$this->redisArray = new RedisArray($servers, $options);
$this->redisArray->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); <- redisarray will try to connect here
why this is bad. I setup everything as lazy in class constructor and expect to catch exceptions only when required server will be called. E.g. if I comment out this line and do call set that will land on "validserver" nothing bad will happen.
Is there reason for such behavior?
The text was updated successfully, but these errors were encountered: