Issue 1:
Checklist

I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussion group first.

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

I have tried reproducing the issue on more than one message broker and/or

result backend.

I have tried reproducing the issue on more than one version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

#5371

#5988

Possible Duplicates

None

Environment & Settings

Celery: 5.0.0

Kombu: 5.0.2

Redis: 3.5.3

vine: 5.0.0

billiard: 3.6.3.0

Steps to Reproduce

Required Dependencies

Minimal Python Version: Python 3.6.5 :: Anaconda, Inc.

Minimal Celery Version: 5.0.0

Minimal Kombu Version: 5.0.2

Minimal Broker Version: Redis Server 6.0.8

Minimal Result Backend Version: Memory / Redis Server 6.0.8

Minimal OS and/or Kernel Version: CentOS 7

Minimal Broker Client Version: RedisPy 3.5.3

Minimal Result Backend Client Version: Memory / RedisPy 3.5.3

Other Dependencies

Needs SSL certificates for Redis TLS setup - I used https://github.com/michaelklishin/tls-gen to create them

Minimally Reproducible Test Case

I have the following configs:

redis_ssl =
broker_connection_retry = False
broker_transport_options = broker_transport_options
# result_backend_transport_options = broker_transport_options
broker_use_ssl = {
'ssl_keyfile': '/home/centos/redis/tls-gen/basic/result/client_key.pem',
'ssl_certfile': '/home/centos/redis/tls-gen/basic/result/client_certificate.pem',
'ssl_ca_certs': '/home/centos/redis/tls-gen/basic/result/ca_certificate.pem',
'ssl_cert_reqs': 'required',
}
# redis_backend_use_ssl = redis_ssl

CELERY_BROKER_URL = 'sentinel://127.0.0.1:29876'
CELERY_RESULT_BACKEND = 'cache+memory://' # Used only for testing - even with Redis here, it doesnt work

With redis.conf:

bind 0.0.0.0
protected-mode yes
port 0

tls-port 9875
tls-cert-file /home/centos/redis/tls-gen/basic/result/server_certificate.pem
tls-key-file /home/centos/redis/tls-gen/basic/result/server_key.pem
tls-ca-cert-file /home/centos/redis/tls-gen/basic/result/ca_certificate.pem
tls-replication yes

daemonize yes
pidfile /home/centos/redis/redis.pid
logfile /home/centos/redis/redis.log
dir /home/centos/redis

With redis-sentinel.conf:

port 29876
tls-port 29875
tls-cert-file "/home/centos/redis/tls-gen/basic/result/server_certificate.pem"
tls-key-file "/home/centos/redis/tls-gen/basic/result/server_key.pem"
tls-ca-cert-file "/home/centos/redis/tls-gen/basic/result/ca_certificate.pem"
tls-replication yes

daemonize yes
pidfile /home/centos/redis/sentinel.pid
logfile /home/centos/redis/sentinel.log
dir /home/centos/redis

sentinel monitor mymaster 127.0.0.1 9875 1
sentinel deny-scripts-reconfig yes
sentinel config-epoch mymaster 6

Expected Behavior

I was expecting Celery to be able to connect to Sentinel, fetch the host and port of the Master.

And then use TLS to connect to the Redis Master.

Actual Behavior

It gives an error TypeError: __init__() got an unexpected keyword argument 'connection_pool'

Traceback:

-------------- celery@ip v5.0.0 (singularity)
--- ***** -----
-- ******* ---- Linux-3.10.0-862.3.2.el7.x86_64-x86_64-with-centos-7.5.1804-Core 2020-11-02 14:00:50
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: corridor_api:0x7fce57b40860
- ** ---------- .> transport: sentinel://IP:29876//
- ** ---------- .> results: memory:///
- *** --- * --- .> concurrency: 1 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> apilocal exchange=apilocal(direct) key=apilocal
.> celery exchange=celery(direct) key=celery

[2020-11-02 14:00:50,595: CRITICAL/MainProcess] Unrecoverable error: TypeError("init() got an unexpected keyword argument 'connection_pool'",)

Traceback (most recent call last):

File "/opt/app/venv/lib/python3.6/site-packages/kombu/transport/virtual/base.py", line 918, in create_channel

return self._avail_channels.pop()

IndexError: pop from empty list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/opt/app/venv/lib/python3.6/site-packages/redis/connection.py", line 1185, in get_connection

connection = self._available_connections.pop()

IndexError: pop from empty list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/opt/app/venv/lib/python3.6/site-packages/celery/worker/worker.py", line 203, in start

self.blueprint.start(self)

File "/opt/app/venv/lib/python3.6/site-packages/celery/bootsteps.py", line 116, in start

step.start(parent)

File "/opt/app/venv/lib/python3.6/site-packages/celery/bootsteps.py", line 365, in start

return self.obj.start()

File "/opt/app/venv/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 311, in start

blueprint.start(self)

File "/opt/app/venv/lib/python3.6/site-packages/celery/bootsteps.py", line 116, in start

step.start(parent)

File "/opt/app/venv/lib/python3.6/site-packages/celery/worker/consumer/connection.py", line 21, in start

c.connection = c.connect()

File "/opt/app/venv/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 398, in connect

conn = self.connection_for_read(heartbeat=self.amqheartbeat)

File "/opt/app/venv/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 405, in connection_for_read

self.app.connection_for_read(heartbeat=heartbeat))

File "/opt/app/venv/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 427, in ensure_connected

conn.connect()

File "/opt/app/venv/lib/python3.6/site-packages/kombu/connection.py", line 277, in connect

max_retries=1, reraise_as_library_errors=False

File "/opt/app/venv/lib/python3.6/site-packages/kombu/connection.py", line 439, in _ensure_connection

callback, timeout=timeout

File "/opt/app/venv/lib/python3.6/site-packages/kombu/utils/functional.py", line 325, in retry_over_time

return fun(*args, **kwargs)

File "/opt/app/venv/lib/python3.6/site-packages/kombu/connection.py", line 866, in _connection_factory

self._connection = self._establish_connection()

File "/opt/app/venv/lib/python3.6/site-packages/kombu/connection.py", line 801, in _establish_connection

conn = self.transport.establish_connection()

File "/opt/app/venv/lib/python3.6/site-packages/kombu/transport/virtual/base.py", line 938, in establish_connection

self._avail_channels.append(self.create_channel(self))

File "/opt/app/venv/lib/python3.6/site-packages/kombu/transport/virtual/base.py", line 920, in create_channel

channel = self.Channel(connection)

File "/opt/app/venv/lib/python3.6/site-packages/kombu/transport/redis.py", line 526, in init

self.client.ping()

File "/opt/app/venv/lib/python3.6/site-packages/redis/client.py", line 1378, in ping

return self.execute_command('PING')

File "/opt/app/venv/lib/python3.6/site-packages/redis/client.py", line 898, in execute_command

conn = self.connection or pool.get_connection(command_name, **options)

File "/opt/app/venv/lib/python3.6/site-packages/redis/connection.py", line 1187, in get_connection

connection = self.make_connection()

File "/opt/app/venv/lib/python3.6/site-packages/redis/connection.py", line 1227, in make_connection

return self.connection_class(**self.connection_kwargs)

File "/opt/app/venv/lib/python3.6/site-packages/redis/connection.py", line 828, in init

super(SSLConnection, self).init(**kwargs)

TypeError: init() got an unexpected keyword argument 'connection_pool'

Issue 2:
Checklist

I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussion group first.

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

I have tried reproducing the issue on more than one message broker and/or

result backend.

I have tried reproducing the issue on more than one version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version: celery==4.4.2

celery report Output:

[2020-05-31 23:28:34,434: INFO/MainProcess] Connected to amqp://remote_worker:**@127.0.0.1:5672//
[2020-05-31 23:28:34,453: INFO/MainProcess] mingle: searching for neighbors
[2020-05-31 23:28:35,487: INFO/MainProcess] mingle: all alone
[2020-05-31 23:28:35,528: WARNING/MainProcess] /home/ubuntu/.local/lib/python3.7/site-packages/celery/fixups/django.py:203: UserWarning: Using settings.DEBUG leads to a memory
leak, never use this setting in production environments!
leak, never use this setting in production environments!''')
[2020-05-31 23:28:35,529: INFO/MainProcess] celery@testroom ready.
[2020-05-31 23:28:47,351: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906]
[2020-05-31 23:28:47,689: WARNING/ForkPoolWorker-1] started
[2020-05-31 23:28:47,690: WARNING/ForkPoolWorker-1] retry
[2020-05-31 23:28:47,721: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:28:57.692348+00:00]
[2020-05-31 23:28:47,722: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:28:57.716321+00:00]
[2020-05-31 23:28:47,777: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] retry: Retry in 10s: Retry(Retry(...), Exception('i have filled now'), 10)
[2020-05-31 23:28:57,999: WARNING/ForkPoolWorker-1] started
[2020-05-31 23:28:58,000: WARNING/ForkPoolWorker-1] ended
[2020-05-31 23:28:58,062: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] succeeded in 0.34440315900428686s: None
[2020-05-31 23:28:58,301: WARNING/ForkPoolWorker-1] started
[2020-05-31 23:28:58,302: WARNING/ForkPoolWorker-1] retry
[2020-05-31 23:28:58,304: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:08.303091+00:00]
[2020-05-31 23:28:58,307: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:08.306141+00:00]
[2020-05-31 23:28:58,368: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] retry: Retry in 10s: Retry(Retry(...), Exception('i have filled now'), 10)
[2020-05-31 23:29:08,572: WARNING/ForkPoolWorker-1] started
[2020-05-31 23:29:08,573: WARNING/ForkPoolWorker-1] ended
[2020-05-31 23:29:08,633: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] succeeded in 0.3256059319974156s: None
[2020-05-31 23:29:08,872: WARNING/ForkPoolWorker-1] started
[2020-05-31 23:29:08,873: WARNING/ForkPoolWorker-1] retry
[2020-05-31 23:29:08,875: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:18.873799+00:00]
[2020-05-31 23:29:08,880: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:18.877550+00:00]
[2020-05-31 23:29:08,940: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] retry: Retry in 10s: Retry(Retry(...), Exception('i have filled now'), 10)
[2020-05-31 23:29:19,144: WARNING/ForkPoolWorker-1] started
[2020-05-31 23:29:19,145: WARNING/ForkPoolWorker-1] ended
[2020-05-31 23:29:19,205: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] succeeded in 0.326258520995907s: None
[2020-05-31 23:29:19,444: WARNING/ForkPoolWorker-1] started
[2020-05-31 23:29:19,445: WARNING/ForkPoolWorker-1] retry
[2020-05-31 23:29:19,505: ERROR/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] raised unexpected: Exception('i have filled now')
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/trace.py", line 385, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/trace.py", line 650, in __protected_call__
return self.run(*args, **kwargs)
File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/base.py", line 500, in run
raise task.retry(exc=exc, **retry_kwargs)
File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/task.py", line 704, in retry
raise_with_context(exc)
File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/base.py", line 487, in run
return task._orig_run(*args, **kwargs)
File "/var/www/django_projects/earthalytics-api/api_v3/tests.py", line 26, in execute
self.retry(exc=Exception("i have filled now"), args=[param_a, param_b], kwargs=kwargs)
File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/task.py", line 704, in retry
raise_with_context(exc)
File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/utils/serialization.py", line 288, in raise_with_context
_raise_with_context(exc, exc_info[1])
File "<string>", line 1, in _raise_with_context
Exception: i have filled now

Steps to Reproduce

Make a celery task with a retry changing one parameters.

Set the max_retries and countdown.

Required Dependencies

Minimal Python Version: N/A or Unknown

Minimal Celery Version: N/A or Unknown

Minimal Kombu Version: N/A or Unknown

Minimal Broker Version: N/A or Unknown

Minimal Result Backend Version: N/A or Unknown

Minimal OS and/or Kernel Version: N/A or Unknown

Minimal Broker Client Version: N/A or Unknown

Minimal Result Backend Client Version: N/A or Unknown

Python Packages

pip freeze Output:

Other Dependencies

N/A

Minimally Reproducible Test Case

@app_cluster.task(bind=True, autoretry_for=(Exception,), max_retries=3,
default_retry_delay=10)
def execute(self, param_a, param_b=None, **kwargs):
print("started")
if param_b is None:
param_b = "filled"
print("retry")
self.retry(exc=Exception("i have filled now"), args=[param_a, param_b], kwargs=kwargs)
print("ended")

def test_celery(self):
sig = execute.si("something")
t = sig.delay()
t = 0

Expected Behavior

I expect the task get overrided with updated parameters

Actual Behavior

The task goes in retry with origianl parameters.

A new task is made with new parameters and get scheduled.

The "old" task get executed.

The "new" task get executed.

The "old" task goes in retry making a "new" "new task" with updated parameters and the "old" goes scheduled again with original parameters.