Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #7997 #7998

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix #7997 #7998

wants to merge 1 commit into from

Conversation

jindaxia
Copy link

@jindaxia jindaxia commented Jan 9, 2023

Fix #7997

Note: Before submitting this pull request, please review our contributing
guidelines
.

Description

In the redis Sentinel class ,if sentinel_kwargs is None, it use 'socket_' in connection_kwargs as the sentinel_kwargs,

    def __init__(
        self,
        sentinels,
        min_other_sentinels=0,
        sentinel_kwargs=None,
        **connection_kwargs,
    ):
        # if sentinel_kwargs isn't defined, use the socket_* options from
        # connection_kwargs
        if sentinel_kwargs is None:
            sentinel_kwargs = {
                k: v for k, v in connection_kwargs.items() if k.startswith("socket_")
            }
        self.sentinel_kwargs = sentinel_kwargs

        self.sentinels = [
            Redis(hostname, port, **self.sentinel_kwargs)
            for hostname, port in sentinels
        ]
        self.min_other_sentinels = min_other_sentinels
        self.connection_kwargs = connection_kwargs

but sentinel_kwargs = self._transport_options.get("sentinel_kwargs", {}) use a empty dict as the default value,
{} is not None,

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect a failing testcase here as well to verify it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when use redis sentinel as backend. the configs ‘broker transport options’ ‘s 'socket_' setting not work
2 participants