hiredis icon indicating copy to clipboard operation
hiredis copied to clipboard

Fix hiredis blocking indefinitely despite timeout being set (#593)

Open catterer opened this issue 2 years ago • 1 comments

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:

  1. DEBUG SLEEP 3 was sent twice because manual c->funcs->write did not flush the connection buffer
  2. DEBUG SLEEP 3 in one test affected the following test

catterer avatar Oct 03 '21 15:10 catterer

Thanks for the PR.

I'm in favor of merging this, but I'm wondering whether this is technically a breaking change?

Relevant XKCD

michael-grunder avatar Jan 18 '22 19:01 michael-grunder

Closing in favor of #1093 (which is just this PR rebased against master).

michael-grunder avatar Aug 29 '22 22:08 michael-grunder