Commit 0a5a0bc
Fix SentinelChannel to pass ACL credentials to master_for() (#2426)
* Fix SentinelChannel to pass ACL credentials to master_for()
When using Redis Sentinel with ACL authentication (username + password),
the SentinelChannel failed to pass credentials to the Redis master connection.
The _connparams() method correctly extracts username and password, but they
were only passed to sentinel.Sentinel() (for sentinel authentication), NOT
to master_for() (for Redis master authentication).
This fix ensures that ACL credentials are forwarded to master_for() so that
Celery workers can connect to Redis Sentinel brokers that use ACL
authentication (Redis 6.0+ feature).
Fixes celery/celery#6301
* Remove commented-out code in Redis Sentinel tests for clarity
* Add test to validate Redis Sentinel connection parameters
This commit adds a test to ensure that the Redis Sentinel connection parameters are correctly passed to the connection class. The test verifies that the patched connection is called with the expected arguments, including the specified host, port, and authentication details.
---------
Co-authored-by: Anton Kuzmich <anton.kuzmich@fairmarkit.com>1 parent f204769 commit 0a5a0bc
2 files changed
Lines changed: 78 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
1480 | 1485 | | |
1481 | 1486 | | |
1482 | 1487 | | |
| 1488 | + | |
1483 | 1489 | | |
1484 | 1490 | | |
1485 | 1491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1934 | 1934 | | |
1935 | 1935 | | |
1936 | 1936 | | |
1937 | | - | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
1938 | 1941 | | |
1939 | 1942 | | |
1940 | 1943 | | |
| |||
1957 | 1960 | | |
1958 | 1961 | | |
1959 | 1962 | | |
1960 | | - | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
1961 | 1967 | | |
1962 | 1968 | | |
1963 | 1969 | | |
| |||
1985 | 1991 | | |
1986 | 1992 | | |
1987 | 1993 | | |
1988 | | - | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
1989 | 2058 | | |
1990 | 2059 | | |
1991 | 2060 | | |
| |||
0 commit comments