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
New 4.3.0 release breaks Redis Sentinel connection #1004
Comments
can you help to bisect the commit causing this? |
Looks like it happened in this commit: a59b44e When running though a debugger, kombu/kombu/transport/redis.py Line 1104 in b4be5cf
This causes the next part to connect to an empty list of sentinels: kombu/kombu/transport/redis.py Lines 1107 to 1111 in b4be5cf
|
Celery (Django) setting: CELERY_BROKER_URL = "sentinel://localhost:26379/0"
CELERY_BROKER_TRANSPORT_OPTIONS = {
'master_name': 'celery-master',
} |
@badcure could you check? |
I'm thinking that maybe something like this ought to fix it. But it's just guesses. - connection_list = []
+ connection_list = [(connparams['host'], connparams['port'])]
for url in self.connection.client.alt:
url = _parse_url(url)
if url.scheme == 'sentinel':
connection_list.append([url.hostname, str(url.port)])
Or: connection_list = []
for url in self.connection.client.alt:
url = _parse_url(url)
if url.scheme == 'sentinel':
connection_list.append([url.hostname, str(url.port)])
+ if not connection_list:
+ connection_list = [(connparams['host'], connparams['port'])] |
The problem is that `self.connection.client.alt` is only populated when there's more than one client URL provided, e.g. `"sentinel://foo;sentinel://bar"`. It will also always contain all URLs, including the primary/first entry. So if the `alt` list is empty, it (usually) means there was only one client URL provided. I also took the liberty to perform name and type changes to be more in line with the examples and documentation in the `redis` library. The argument is `sentinels`, not `connection_list`. And it's of the type `List[Tuple[str, int]]`, not `List[List[str, str]]`. Fixes celery#1004
Tried to fix this in #1010. |
The problem is that `self.connection.client.alt` is only populated when there's more than one client URL provided, e.g. `"sentinel://foo;sentinel://bar"`. It will also always contain all URLs, including the primary/first entry. So if the `alt` list is empty, it (usually) means there was only one client URL provided. I also took the liberty to perform name and type changes to be more in line with the examples and documentation in the `redis` library. The argument is `sentinels`, not `connection_list`. And it's of the type `List[Tuple[str, int]]`, not `List[List[str, str]]`. Fixes #1004
Hello All, I know this is issue is for 4.3, but it seems that 4.2.1 has that issue as well. and the same workaround applies. ==> /apps/run/logs/app_name.internal.worker.log <== I changed the broker_url to be the two LB names instead of the GSLB name and that seems to have fixed it. Here is the pip list amqp 2.4.1 |
The new 4.3.0 breaks the Redis Sentinel connection, triggering an error like when queueing a task:
While starting a celery worker gives this error
kombu==4.2.2-post1
did not have this issue.Redis library = 3.0.1
The text was updated successfully, but these errors were encountered: