hiredis
hiredis copied to clipboard
Fix hiredis blocking indefinitely despite timeout being set (#593)
Currently, redisSetTimeout
function does not update command_timeout
field in the context.
The following call to redisReconnect
then resets the socket timeout to infinity.
This is probably the root cause of the issues (#593), (#718), (#263), (#517).
This PR fixes the bug and also fixes the corresponding test, which had two issues:
- DEBUG SLEEP 3 was sent twice because manual
c->funcs->write
did not flush the connection buffer - DEBUG SLEEP 3 in one test affected the following test
Thanks for the PR.
I'm in favor of merging this, but I'm wondering whether this is technically a breaking change?
Closing in favor of #1093 (which is just this PR rebased against master).