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

Set Redis read_timout earlier #24748

Closed
dzuelke opened this issue Jul 5, 2018 · 1 comment
Closed

Set Redis read_timout earlier #24748

dzuelke opened this issue Jul 5, 2018 · 1 comment

Comments

@dzuelke
Copy link

dzuelke commented Jul 5, 2018

The read_timeout parameter is currently, correctly, set using setOption() in PhpRedisConnector::createClient() after the connection was created.

The additional sixth argument to connect() was added in ext-redis/3.1.3 (phpredis/phpredis@b56dc4), so older versions won't have it.

However, it might make sense to detect the redis extension version (using phpversion("redis")) and pass the option to the connect() method if possible, as otherwise, the authentication and database selection steps are not subject to the read timeout.

If not, then maybe there should be a comment to explain why it's done this way, to prevent some future "improvement" that moves it to the argument without a version check ;)

Alternatively, just pass the argument to connect() if it's configured in Laravel and skip it otherwise; judging from the ext-redis commits and changelog entry, the read timeout option was broken before 3.1.3 anyway.

@tillkruss
Copy link
Contributor

Could you submit a PR, or shall I?

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

2 participants