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
Exception thrown in blPop() #99
Comments
Thank you for reporting this, I'll have a look this week-end. |
Same or similar problem on empty or not existent lists:
|
When I tested this with a 10 second timeout I got a "read error on connection" in ~2.5 seconds. I am not using pconnect. When I test it with a Credis_Client (standalone php) it fails the 60 second test (works up to 50 seconds). The server timeout is set to 300 seconds. It seems phpredis does not handle blocking or long-running calls correctly in general. |
set default_socket_timeout=-1 in php.ini and set parameter timeout=3 when connecting and be sure that your timeout in config of redis server is zero, then the problem will be fixed |
Indeed, the default_socket_timeout is 60 seconds on my system. However, it would be best for this timeout to be set at runtime by the Redis driver. |
Although it would indeed solve the problem in this particular case, it is not the library's role to silently override system-wide settings for which the admin is responsible. |
Sockets can be used for so many things though.. You may want a 60 second timeout when connecting to an API service, but a 20 minute timeout when connecting to Redis for a blocking or pub/sub operation. Perhaps this should be added as an additional parameter/method so the programmer can make this decision and not the admin? |
I ran a few tests and I think this is what's happening:
In theory, the socket timeout value could be updated with the value passed into |
* The value is also configurable just like connectTimeout * This deals with problems like phpredis/phpredis#99 and phpredis/phpredis#70 Change-Id: I05e91e05764020854d04673b7decae30359f57e9
try{ |
I'm getting an exception "read error on connection" when trying to do a blocking LPOP on a list (list doesn't exist actually).
The code is pretty simple
It takes about 3-4 seconds and the exception is thrown. Other commands seem to work fine.
Here some strace output:
No idea why it throws the exception and then even closes the connection to redis.
I tried other timeout values but it's always the same. As seen on the strace output, it doesn't even wait long enough for the timeout to expire.
The text was updated successfully, but these errors were encountered: