-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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_intervalonly useful whensocket_timeoutis also set? Orsocket_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_timeoutis about timing out the connection-establishment process andsocket_timeoutis about send and receive, but what isn't clear to me is howsocket_timeoutdeals with blocking Redis commands likeBLPOP. When we call commands likeLLENorRPUSH, we would like those to time out very quickly (say, ~2-3 seconds). However, we also makeBLPOPcalls, and for those we use anything fromtimeout=2totimeout=120(depending on the use case) to wait for data to be available on the list. So, given that, if we havesocket_timeoutset to 5 seconds and we callBLPOPwithtimeout=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 overridesocket_timeoutif higher thansocket_timeout?