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 protocol error #1106

Merged
merged 3 commits into from
Sep 5, 2022
Merged

Fix protocol error #1106

merged 3 commits into from
Sep 5, 2022

Conversation

michael-grunder
Copy link
Collaborator

Implement a fix for a recoverable write failure

See #961 for more discussion

mtuleika-appcast and others added 2 commits September 4, 2022 12:11
This commit attempts to fix hiredis such that a recoverable write error
will be retried rather than throwing a hard error.

Since our read/write functions are now behind function pointers, we
specify semantically that a return value of < 0 is a hard error, 0 a
recoverable error, and > 0 a success.

Our default `redisNetRead` function was already doing something similar
so this also improves code consistency.

See #961
@michael-grunder michael-grunder mentioned this pull request Sep 4, 2022
@michael-grunder
Copy link
Collaborator Author

michael-grunder commented Sep 4, 2022

cc @yossigo Let me know if anything jumps out at you. Since we're now fully abstracting read/write functions I figured we could just specify < 0 an unrecoverable error 0 a recoverable one, and > 0 as success. in the callbacks, which should work even for some exotic future read/write callback.

net.c Show resolved Hide resolved
net.c Show resolved Hide resolved
@yossigo
Copy link
Member

yossigo commented Sep 5, 2022

@michael-grunder This makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants