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
Connection timed out #385
Comments
First thing, your change is actually wrong as you are passing the value of |
@nrk thanks for your answer, I've made some tests: It's working fine with:
And I have the error with:
|
Now I still don't get how it is even possible that you get an error when you don't assign a custom value to timeout via connection parameters considering this line where |
I guess you set a error config, say set a empty timeout, and as a result $timeout become to 0; You may debug the timeout value passed to the function. What do you think, @nrk protected function createStreamSocket(ParametersInterface $parameters, $address, $flags)
{
$timeout = (isset($parameters->timeout) ? (float) $parameters->timeout : 5.0);
//debug here
var_dump($timeout);
if (!$resource = @stream_socket_client($address, $errno, $errstr, $timeout, $flags)) {
$this->onConnectionError(trim($errstr), $errno);
} |
I'm closing this due to lack of feedback, feel free to re-open it if you have more details to share and are still interested in it. |
Hi guys,
I have a strange behaviour using predis with a php/symfony application.
Everytime the application tries to connect to redis, I got this in the logs:
This is not a firewall or remote connection issue because, if I use telnet on the exact same "redis_ip_server" and port 6379, the connection is OK and I'm able to set and get keys... so basically the connection is timed out only when using predis.
After a couple of hours, I've finally fixed this issue by changing one line in predis/src/Connection/StreamConnection.php on line 127:
BY
I don't really understand why I have to do this...
Is it an issue on your side or mine ? I hope maybe you can help me understand.
For information, I'm using the official redis docker container as my redis server (v3.2.4).
Thanks a lot.
The text was updated successfully, but these errors were encountered: