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

Fix random connection timeouts with Redis Cluster #2459

Merged
merged 1 commit into from Mar 25, 2024

Conversation

kjoe
Copy link
Contributor

@kjoe kjoe commented Mar 17, 2024

When a node timeout occurs, then phpredis will try to connect to another node, whose answer probably will be MOVED redirect. After this we need more time to accomplish the redirection, otherwise we get "Timed out attempting to find data in the correct node" error message immediately in the first cycle.

Especially under Kubernetes with StatefulSet installation, where IP addresses could change over time, or after redeployment. Old IPs will be unaccessible, but the call will survive with this fix, and does not cause timeout errors.

fixes #795, fixes #888, fixes #1142, fixes #1385, fixes #1633, fixes #1707, fixes #1811, fixes #2407

When a node timeout occurs, then phpredis will try to connect to another
node, whose answer probably will be MOVED redirect. After this we need
more time to accomplish the redirection, otherwise we get "Timed out
attempting to find data in the correct node" error message.

Fixes phpredis#795 phpredis#888 phpredis#1142 phpredis#1385 phpredis#1633 phpredis#1707 phpredis#1811 phpredis#2407
@michael-grunder
Copy link
Member

It makes sense to default to timeout + read_timeout here, although this commit does change behavior so we need to be careful about it.

@michael-grunder michael-grunder merged commit eb7f31e into phpredis:develop Mar 25, 2024
28 checks passed
@michael-grunder
Copy link
Member

Merged, thanks!

@TheLevti
Copy link

Is there any timeline when this is going to be released in a new version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment