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

bf: MD-989 try next sentinels after I/O timeout errors #12

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

jonathan-gramain
Copy link
Collaborator

This fixes an issue that causes other sentinels not to be tried after one of them fails with an I/O timeout.

The root cause is that the code attempts to abort early if the error is of one of the types generated by the context module, in this case, context.DeadlineExceeded, but it doesn't check that the error comes from the context argument provided to the function. Since the network layer also uses context to manage timeouts, it returns the same type of error, which is mistakenly assumed as coming from the passed context.

The fix consists of checking whether the ctx object passed to the function is in error state to abort early, and continue trying the next sentinels otherwise.

The commit that introduced the early abortion on context error and caused this regression is:

redis/go-redis@63392a3

This fixes an issue that causes other sentinels not to be tried after
one of them fails with an I/O timeout.

The root cause is that the code attempts to abort early if the error
is of one of the types generated by the context module, in this case,
`context.DeadlineExceeded`, but it doesn't check that the error comes
from the context argument provided to the function. Since the network
layer also uses context to manage timeouts, it returns the same type
of error, which is mistakenly assumed as coming from the passed
context.

The fix consists of checking whether the `ctx` object passed to the
function is in error state to abort early, and continue trying the
next sentinels otherwise.

The commit that introduced the early abortion on context error and
caused this regression is:

redis/go-redis@63392a3
@anurag4DSB
Copy link

I am curious about the v versions, whats the branching and versioning scheme we follow here?

Copy link

@anurag4DSB anurag4DSB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonathan-gramain
Copy link
Collaborator Author

@anurag4DSB the v9.7 branch is the latest stable branch in go-redis upstream repo at this time.

@jonathan-gramain jonathan-gramain merged commit d8efc29 into v9.7 Nov 22, 2024
8 checks passed
@jonathan-gramain jonathan-gramain deleted the bugfix/MD-989-tryNextSentinelsAfterIOTimeout branch November 22, 2024 17:40
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

Successfully merging this pull request may close these issues.

3 participants