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

Fixed issue with invoking _close() on closed event loop #3438

Merged
merged 11 commits into from
Dec 5, 2024
Prev Previous commit
Next Next commit
Revert weakref changes
  • Loading branch information
vladvildanov committed Dec 5, 2024
commit c0d24e6d10389bffe50e1a47502b43b05ac96651
5 changes: 2 additions & 3 deletions redis/asyncio/sentinel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import random
import weakref
from typing import AsyncIterator, Iterable, Mapping, Optional, Sequence, Tuple, Type

from redis.asyncio.client import Redis
Expand Down Expand Up @@ -28,10 +29,8 @@ def __init__(self, **kwargs):
super().__init__(**kwargs)

def __repr__(self):
pool = self.connection_pool
s = (
f"<{self.__class__.__module__}.{self.__class__.__name__}"
f"(service={pool.service_name}"
)
if self.host:
host_info = f",host={self.host},port={self.port}"
Expand Down Expand Up @@ -116,7 +115,7 @@ def __init__(self, service_name, sentinel_manager, **kwargs):
self.is_master = kwargs.pop("is_master", True)
self.check_connection = kwargs.pop("check_connection", False)
super().__init__(**kwargs)
self.connection_kwargs["connection_pool"] = self
self.connection_kwargs["connection_pool"] = weakref.proxy(self)
self.service_name = service_name
self.sentinel_manager = sentinel_manager
self.master_address = None
Expand Down
Loading