Skip to content

Using sentinel config hangs for many seconds if one or more sentinels are down #540

Open
@neumantm

Description

@neumantm

Due to a poorly configured socket_timeout for the connection to the sentinels,
the connection may hang for many seconds or even minutes when one ore more of the configured sentinels are down.
Then the django cache hangs for the same time causing http timeouts for users.
This is bad, as the purpose of using sentinels is that something can go down without the user noticing.

A workaround is setting OPTIONS["SENTINEL_KWARGS"] = {"socket_timeout": 1}.

I think we should set a better default. ( It seems the current default is somewhere around 30 seconds, which means with two offline sentinels it would be around 60 seconds of hang. According to redis-py the default is gotten from the connection_kwargs, but I do not know where that is set)

It should at least be documented.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions