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

Sentinel connection proxy master variable incorrect #3384

Open
mayank-apnamart opened this issue Sep 26, 2024 · 0 comments
Open

Sentinel connection proxy master variable incorrect #3384

mayank-apnamart opened this issue Sep 26, 2024 · 0 comments

Comments

@mayank-apnamart
Copy link

mayank-apnamart commented Sep 26, 2024

Version: 5.0.3

Platform: Python 3.11 on Azure

Description: The SentinelConnectionProxy is_master variable is initialized incorrectly to '0' rather than boolean, hence does not use slaves

``
class SentinelConnectionPool(ConnectionPool):
"""
Sentinel backed connection pool.

If ``check_connection`` flag is set to True, SentinelManagedConnection
sends a PING command right after establishing the connection.
"""

def __init__(self, service_name, sentinel_manager, **kwargs):
    kwargs["connection_class"] = kwargs.get(
        "connection_class",
        SentinelManagedSSLConnection
        if kwargs.pop("ssl", False)
        else SentinelManagedConnection,
    )
    self.is_master = kwargs.pop("is_master", True)
    self.check_connection = kwargs.pop("check_connection", False)
    self.proxy = SentinelConnectionPoolProxy(
        connection_pool=self,
        is_master=self.is_master,
        check_connection=self.check_connection,
        service_name=service_name,
        sentinel_manager=sentinel_manager,
    )
    super().__init__(**kwargs)
    self.connection_kwargs["connection_pool"] = self.proxy
    self.service_name = service_name
    self.sentinel_manager = sentinel_manager

``

Here is_master pops to 0

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

No branches or pull requests

1 participant