Skip to content

Need clarification and better documentation on socket_timeout, socket_connect_timeout, and blocking commands #1232

@nickwilliams-eventbrite

Description

Version: 2.10.6 but thinking about upgrading to 3.3.11 to hopefully address this and need clarification

Platform: Ubuntu 16.04 on Python 3.7

Description: We've having an issue that is making us consider upgrading our stack to 3.3.11, but we need some clarification on some things that are insufficiently documented and that I've been unable to determine from reading through the code.

The issue at hand is that, when Sentinel fails over due to a hard failed master, the clients will block for many minutes hoping to receive some response from the now-dead master, and then the Sentinel client doesn't appear to load new master info as far as I can tell. We think what we need to employ here is some socket timeouts (socket_connect_timeout and/or socket_timeout) and possibly also the new health_check_interval parameter added to 3.3.x.

But I have some concerns around these issues because the documentation doesn't really explain what the three arguments in question do. So here are my two questions that I'm hoping to get quick answers for and also hoping that the documentation can be updated to reflect.

  • Is health_check_interval only useful when socket_timeout is also set? Or socket_connect_timeout? Or can it be useful with either and more useful with both? Basically, how do these three options interact?
  • I get that socket_connect_timeout is about timing out the connection-establishment process and socket_timeout is about send and receive, but what isn't clear to me is how socket_timeout deals with blocking Redis commands like BLPOP. When we call commands like LLEN or RPUSH, we would like those to time out very quickly (say, ~2-3 seconds). However, we also make BLPOP calls, and for those we use anything from timeout=2 to timeout=120 (depending on the use case) to wait for data to be available on the list. So, given that, if we have socket_timeout set to 5 seconds and we call BLPOP with timeout=120, will it timeout in 5 seconds (bad) or 120 seconds (intended)? If 5 seconds, can the blocking commands be modified so that their timeouts override socket_timeout if higher than socket_timeout?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions