Skip to content

Maintenance notification warning if protocol=3 #3852

@Lukas0907

Description

@Lukas0907

Hi,

since redis-py v7 a warning is issued if protocol=3 but the server doesn't support the latest maintenance notification feature:

>>> import redis
>>> r = redis.Redis()
>>> r.get('foo')
>>> r = redis.Redis(protocol=3)
>>> r.get('foo')
Failed to enable maintenance notifications: unknown subcommand 'MAINT_NOTIFICATIONS'. Try CLIENT HELP.

By explicitly disabling the feature the warning also disappears:

>>> import redis
>>> from redis.maint_notifications import MaintNotificationsConfig
>>> r = redis.Redis(protocol=3, maint_notifications_config=MaintNotificationsConfig(enabled=False))
>>> r.get('foo')

The default for maintenance configuration is "auto". IMHO, this implies a more graceful handling of unsupported servers, i.e., not logging anything. Maybe this warning could simply 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