Issue 1:
Checklist

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 report Output:

[root@shiny ~]# celery report

software -> celery:4.4.0rc2 (cliffs) kombu:4.6.3 py:3.6.8
billiard:3.6.0.0 py-amqp:2.5.0
platform -> system:Linux arch:64bit
kernel version:4.19.13-200.fc28.x86_64 imp:CPython
loader -> celery.loaders.default.Loader
settings -> transport:amqp results:disabled

Steps to Reproduce

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:

[root@shiny ~]# pip3 freeze
amqp==2.5.0
anymarkup==0.7.0
anymarkup-core==0.7.1
billiard==3.6.0.0
celery==4.4.0rc2
configobj==5.0.6
gpg==1.10.0
iniparse==0.4
json5==0.8.4
kombu==4.6.3
pygobject==3.28.3
python-qpid-proton==0.28.0
pytz==2019.1
PyYAML==5.1.1
pyzmq==18.0.1
redis==3.2.1
rpm==4.14.2
six==1.11.0
smartcols==0.3.0
toml==0.10.0
ucho==0.1.0
vine==1.3.0
xmltodict==0.12.0

Other Dependencies

N/A

Minimally Reproducible Test Case

Expected Behavior

Updating task_routes during runtime is possible and has effect

Actual Behavior

Updating task_routes during runtime does not have effect - the config is updated but the router in send_task seems to be reusing old configuration.

import celery

c = celery.Celery(broker='redis://localhost:6379/0',
backend='redis://localhost:6379/0')

c.conf.update(task_routes={'task.create_pr': 'queue.betka'})
c.send_task('task.create_pr')
print(c.conf.get('task_routes'))

c.conf.update(task_routes={'task.create_pr': 'queue.ferdinand'})
c.send_task('task.create_pr')
print(c.conf.get('task_routes'))

Output:

[root@shiny ~]# python3 repr.py
{'task.create_pr': 'queue.betka'}
{'task.create_pr': 'queue.ferdinand'}

So the configuration is updated but it seems the routes are still pointing to queue.betka, since both tasks are sent to queue.betka and queue.ferdinand didn't receive anything.

betka_1 | [2019-06-24 14:50:41,386: INFO/MainProcess] Received task: task.create_pr[54b28121-28cf-4301-b6f2-185d2e7c50cb]
betka_1 | [2019-06-24 14:50:41,386: DEBUG/MainProcess] TaskPool: Apply <function _fast_trace_task at 0x7fca7f4d6a60> (args:('task.create_pr', '54b28121-28cf-4301-b6f2-185d2e7c50cb', {'lang': 'py', 'task': 'task.create_pr', 'id': '54b28121-28cf-4301-b6f2-185d2e7c50cb', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'retries': 0, 'timelimit': [None, None], 'root_id': '54b28121-28cf-4301-b6f2-185d2e7c50cb', 'parent_id': None, 'argsrepr': '()', 'kwargsrepr': '{}', 'origin': 'gen68@shiny', 'reply_to': 'b7be085a-b1f8-3738-b65f-963a805f2513', 'correlation_id': '54b28121-28cf-4301-b6f2-185d2e7c50cb', 'delivery_info': {'exchange': '', 'routing_key': 'queue.betka', 'priority': 0, 'redelivered': None}}, b'[[], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]', 'application/json', 'utf-8') kwargs:{})
betka_1 | [2019-06-24 14:50:41,387: INFO/MainProcess] Received task: task.create_pr[3bf8b0fb-cb4a-412b-84d4-1a52b794b4e0]
betka_1 | [2019-06-24 14:50:41,388: DEBUG/MainProcess] Task accepted: task.create_pr[54b28121-28cf-4301-b6f2-185d2e7c50cb] pid:12
betka_1 | [2019-06-24 14:50:41,390: INFO/ForkPoolWorker-1] Task task.create_pr[54b28121-28cf-4301-b6f2-185d2e7c50cb] succeeded in 0.002012896991800517s: 'Maybe later :)'
betka_1 | [2019-06-24 14:50:41,390: DEBUG/MainProcess] TaskPool: Apply <function _fast_trace_task at 0x7fca7f4d6a60> (args:('task.create_pr', '3bf8b0fb-cb4a-412b-84d4-1a52b794b4e0', {'lang': 'py', 'task': 'task.create_pr', 'id': '3bf8b0fb-cb4a-412b-84d4-1a52b794b4e0', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'retries': 0, 'timelimit': [None, None], 'root_id': '3bf8b0fb-cb4a-412b-84d4-1a52b794b4e0', 'parent_id': None, 'argsrepr': '()', 'kwargsrepr': '{}', 'origin': 'gen68@shiny', 'reply_to': 'b7be085a-b1f8-3738-b65f-963a805f2513', 'correlation_id': '3bf8b0fb-cb4a-412b-84d4-1a52b794b4e0', 'delivery_info': {'exchange': '', 'routing_key': 'queue.betka', 'priority': 0, 'redelivered': None}}, b'[[], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]', 'application/json', 'utf-8') kwargs:{})
betka_1 | [2019-06-24 14:50:41,391: DEBUG/MainProcess] Task accepted: task.create_pr[3bf8b0fb-cb4a-412b-84d4-1a52b794b4e0] pid:12
betka_1 | [2019-06-24 14:50:41,391: INFO/ForkPoolWorker-1] Task task.create_pr[3bf8b0fb-cb4a-412b-84d4-1a52b794b4e0] succeeded in 0.0006862019945401698s: 'Maybe later :)'

Note: I managed to workaround it by adding del c.amqp right after update for now

Issue 2:
Checklist

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).

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version: celery==4.2.1

celery report Output:

job.save(backend=tasks.cel.backend)
File "/Users/shaunak/instabase-repo/instabase/venv/lib/python2.7/site-packages/celery/result.py", line 887, in save
return (backend or self.app.backend).save_group(self.id, self)
File "/Users/shaunak/instabase-repo/instabase/venv/lib/python2.7/site-packages/celery/backends/base.py", line 399, in save_group
return self._save_group(group_id, result)
AttributeError: 'CassandraBackend' object has no attribute '_save_group'

Steps to Reproduce

Start celery with Cassandra as a backend

import celery
import time

cel = celery.Celery(
'experiments',
backend='cassandra://',
broker='amqp://localhost:5672'
)

cel.conf.update(
CELERYD_PREFETCH_MULTIPLIER = 1,
CELERY_REJECT_ON_WORKER_LOST=True,
CELERY_TASK_REJECT_ON_WORKER_LOST=True,
CASSANDRA_SERVERS=['localhost'],
)

Create a group and try to save the result

job = group_sig.delay()
job.save(backend=tasks.cel.backend)

Expected Behavior

We expect that the result will be saved without throwing an error.

Actual Behavior

We see the following error:

job.save(backend=tasks.cel.backend)
File "/Users/shaunak/instabase-repo/instabase/venv/lib/python2.7/site-packages/celery/result.py", line 887, in save
return (backend or self.app.backend).save_group(self.id, self)
File "/Users/shaunak/instabase-repo/instabase/venv/lib/python2.7/site-packages/celery/backends/base.py", line 399, in save_group
return self._save_group(group_id, result)
AttributeError: 'CassandraBackend' object has no attribute '_save_group'