Skip to content

redis sentinel channel lost health_check_interval in connparams #2362

@hot123s

Description

@hot123s

Description

redis sentinel channel lost health_check_interval in connparams

Reproduction

from kombu.connection import Connection
from kombu.utils.functional import accepts_argument
from redis import sentinel

conn_class = sentinel.SentinelManagedConnection
conn = Connection("sentinel://127.0.0.1:26379;sentinel://127.0.0.2:26379;sentinel://127.0.0.3:26379")
connparams = {"health_check_interval": 30}
if hasattr(conn_class, "__init__"):
    # check health_check_interval for the class and bases
    # classes
    classes = [conn_class]
    if hasattr(conn_class, "__bases__"):
        classes += list(conn_class.__bases__)
    for klass in classes:
        if accepts_argument(klass.__init__, "health_check_interval"):
            break
    else:  # no break
        connparams.pop("health_check_interval")
assert "health_check_interval" in connparams

Suggestion

Latest Kombu require redis-py>=4.5.2 , and redis.connection.AbstractConnections already contains health_check_interval param.

So it looks like relative check could be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions