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

None

Possible Duplicates

None

Environment & Settings

Celery version:

celery report Output:

Steps to Reproduce

The 4.4.2 version does not include the 4.4.2 changes. When SSL connections were failing, I checked. It seems like the zip files do not reflect the commits.

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

Expected Behavior

Actual Behavior

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

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.

Environment & Settings

Celery version: 4.3.0 (rhubarb)

celery report Output:

software -> celery:4.3.0 (rhubarb) kombu:4.6.5 py:3.6.5
billiard:3.6.1.0 py-amqp:2.5.1
platform -> system:Darwin arch:64bit
kernel version:18.7.0 imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:amqp results:amqp://localhost/

broker_url: 'amqp://guest:********@localhost:5672//'
result_backend: 'amqp://localhost/'
include: ['distributed.tasks']
task_queues:
(<unbound Queue bcast.f392d4ff-cb2a-48d0-bd9b-fb60c16b85e5 -> <unbound Exchange broadcast_tasks(fanout)> -> >,)
task_routes: {
'tasks.reload_cache': { 'exchange': 'broadcast_tasks',
'queue': 'broadcast_tasks'}}

Steps to Reproduce

Required Dependencies

Minimal Python Version: 3.6

Minimal Celery Version: 4.3.0

Minimal Kombu Version: 4.6.5

Minimal Broker Version: N/A or Unknown

Minimal Result Backend Version: 3.7.14 (rabbitmq) 5.0.5 (redis)

Minimal OS and/or Kernel Version: macOS Mojave 10.14.6

Minimal Broker Client Version: 3.7.14 (rabbitmq) 5.0.5 (redis)

Minimal Result Backend Client Version: Unknown

Python Packages

pip freeze Output:

absl-py==0.8.0
alabaster==0.7.11
amqp==2.5.1
anyjson==0.3.3
appnope==0.1.0
asn1crypto==0.24.0
astor==0.6.2
astroid==1.6.5
atomicwrites==1.2.1
attrs==18.2.0
aws-xray-sdk==0.95
awscli==1.16.88
Babel==2.6.0
backcall==0.1.0
billiard==3.6.1.0
bilm==0.1.post5
bleach==1.5.0
boto==2.48.0
boto3==1.7.45
botocore==1.10.45
Bottleneck==1.2.1
bson==0.5.7
bz2file==0.98
celery==4.3.0
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
Click==7.0
cloudpickle==0.5.3
colorama==0.4.1
coloredlogs==10.0
conllu==0.11
cookies==2.2.1
coverage==4.5.3
cryptography==2.4.2
cycler==0.10.0
cymem==2.0.2
Cython==0.29.13
cytoolz==0.9.0.1
dataclasses==0.6
decorator==4.3.0
dill==0.2.8.2
docker==3.7.0
docker-pycreds==0.4.0
docopt==0.6.2
docutils==0.14
ecdsa==0.13
editdistance==0.5.2
entrypoints==0.2.3
environs==5.2.1
et-xmlfile==1.0.1
falcon==2.0.0
fasttext==0.8.22
flaky==3.5.2
-e git+https://github.com/lzfelix/flare.git@29d9b1aef10c08c8b00b5e42a7ca7869b54d9549#egg=flare
Flask==1.0.2
Flask-Cors==3.0.7
Flask-DotEnv==0.1.2
# Editable install with no version control (flaskr==1.0.0)
-e /Users/lzfelix/Desktop/sandbox/flask-tutorial
flower==0.9.3
ftfy==5.5.0
future==0.17.1
gast==0.2.0
gensim==3.4.0
gevent==1.3.6
google-pasta==0.1.7
greenlet==0.4.15
grpcio==1.12.1
gunicorn==19.9.0
h5py==2.8.0
honeybee==0.1.0a3
html5lib==0.9999999
humanfriendly==4.18
idna==2.7
imagesize==1.0.0
importlib-metadata==0.23
ipykernel==4.8.2
ipython==6.4.0
ipython-genutils==0.2.0
isort==4.3.4
itsdangerous==1.1.0
jdcal==1.4
jedi==0.12.0
Jinja2==2.10
jmespath==0.9.3
joblib==0.13.2
jsondiff==1.1.1
jsonpickle==0.9.6
jsonschema==2.6.0
jupyter-client==5.2.3
jupyter-core==4.4.0
jupyterlab==0.32.1
jupyterlab-launcher==0.10.5
Keras==2.2.2
Keras-Applications==1.0.4
# Editable install with no version control (keras-contrib==2.0.8)
-e /Users/lzfelix/miniconda3/envs/exp/lib/python3.6/site-packages
Keras-Preprocessing==1.0.2
kiwisolver==1.0.1
kombu==4.6.5
lazy-object-proxy==1.3.1
-e git+https://github.com/ntucllab/libact.git@ade1e4b6e86736374e13fc5735523069e0e22d85#egg=libact
livereload==2.6.0
lxml==4.4.1
Markdown==2.6.11
MarkupSafe==1.0
marshmallow==3.0.1
matplotlib==2.2.3
mccabe==0.6.1
mistune==0.8.3
mkdocs==1.0.4
mock==2.0.0
-e git+https://github.com/modAL-python/modAL.git@356e3e4d60f5c2c3294568495a7fb7f42c459386#egg=modAL
more-itertools==4.3.0
moto==1.3.4
msgpack==0.5.6
msgpack-numpy==0.4.3.2
munch==2.3.2
murmurhash==1.0.1
mypy==0.700
mypy-extensions==0.4.1
nbconvert==5.3.1
nbformat==4.4.0
nbsphinx==0.4.2
nltk==3.3
notebook==5.5.0
nteract-on-jupyter==1.9.6
numpy==1.16.0
olefile==0.45.1
openpyxl==2.5.10
-e git+https://github.com/lzfelix/opytimizer.git@ad1ae251be25d7215a29a163f7c12a457e94c6fc#egg=opytimizer
overrides==1.9
packaging==19.0
pandas==0.24.2
pandocfilters==1.4.2
parsimonious==0.8.0
parso==0.2.1
pbr==5.1.1
pep8==1.7.1
pexpect==4.6.0
pickleshare==0.7.4
Pillow==5.1.0
plac==0.9.6
plotly==3.1.1
pluggy==0.8.0
preshed==2.0.1
prompt-toolkit==1.0.15
protobuf==3.9.1
ptpython==0.41
ptyprocess==0.6.0
py==1.7.0
py-cpuinfo==5.0.0
pyaml==18.11.0
pyasn1==0.4.5
pybind11==2.2.3
pycparser==2.18
pycryptodome==3.7.2
pydantic==0.32.2
pydot==1.4.1
Pygments==2.2.0
pylint==1.9.2
pyparsing==2.2.0
pytest==4.0.2
python-dateutil==2.7.3
python-docx==0.8.10
python-dotenv==0.10.3
python-jose==2.0.2
python-magic==0.4.15
python-redis-lock==3.3.1
pytorch-crf==0.7.2
pytorch-pretrained-bert==0.3.0
pytreebank==0.2.4
pytz==2017.3
PyYAML==3.12
pyzmq==17.0.0
# Editable Git install with no remote (rc-semaphore==0.1)
-e /Users/lzfelix/Desktop/sandbox/semaphores
redis==3.2.1
Redis-Semaphore==0.2.2
regex==2018.1.10
requests==2.19.1
requests-futures==0.9.9
responses==0.10.5
retrying==1.3.3
rope==0.12.0
rsa==3.4.2
s3transfer==0.1.13
sacred==0.7.5
scikit-learn==0.19.2
scipy==1.1.0
seaborn==0.9.0
Send2Trash==1.5.0
simplegeneric==0.8.1
six==1.11.0
# Editable install with no version control (sk-seqtools==0.0.2)
-e /Users/lzfelix/miniconda3/envs/exp/lib/python3.6/site-packages
sklearn==0.0
smart-open==1.5.7
snowballstemmer==1.2.1
spacy==2.0.18
Sphinx==1.7.5
sphinxcontrib-websupport==1.1.0
sqlparse==0.2.4
tenacity==5.1.1
tensorboard==1.8.0
tensorboardX==1.2
tensorflow==1.8.0
tensorflow-estimator==1.13.0
termcolor==1.1.0
terminado==0.8.1
testpath==0.3.1
textblob==0.15.1
thinc==6.12.1
toml==0.10.0
toolz==0.9.0
torch==1.0.0
torchsummary==1.5.1
torchtext==0.3.1
torchvision==0.2.1
tornado==5.1.1
tqdm==4.31.1
traitlets==4.3.2
typed-ast==1.3.1
ujson==1.35
Unidecode==1.0.22
urllib3==1.23
vine==1.3.0
wcwidth==0.1.7
websocket-client==0.54.0
Werkzeug==0.14.1
wrapt==1.11.2
xlrd==1.1.0
XlsxWriter==1.1.8
xmltodict==0.11.0
zipp==0.6.0

Other Dependencies

N/A

Minimally Reproducible Test Case

Project tree:
.
├── __init__.py
├── callables
│ ├── __init__.py
│ └── broadcaster.py
└── distributed
├── __init__.py
├── celery.py
└── tasks.py

# celery.py
from celery import Celery
from kombu.common import Broadcast

app = Celery(
'src',
broker='amqp://localhost',
backend='amqp://localhost',
include=[
'distributed.tasks'
]
)

app.conf.task_queues = (Broadcast('broadcast_tasks'),)
app.conf.task_routes = {'tasks.reload_cache': {'queue': 'broadcast_tasks'}}
app.conf.task_routes = {
'tasks.reload_cache': {
'queue': 'broadcast_tasks',
'exchange': 'broadcast_tasks'
}
}

# tasks
import time
from distributed.celery import app

@app.task
def perform_some_task(value: int) -> None:
print(f'Executing task {value}')
time.sleep(3)
print(f'Task {value} is ready')

@app.task
def reload_cache() -> None:
print('hi')
time.sleep(2)
print('bye')

# broadcaster.py
from distributed import tasks

r = tasks.reload_cache.apply_async(None, serializer="json", queue='broadcast_tasks')
print(r.get())

# Steps to reproduce:
1. Start the worker with celery -A distributed worker -B -l info -O fair -Q broadcast_tasks -E

2. Run python broadcaster.py

Expected Behavior

I'm trying to make the message sent to the queue broadcast_tasks to be received by all workers, but only one receives and processes the task. My actual goal was to perform this task using redis as backend end broker, but it didn't work. I've switched to rabbitmq and the issue persists.

Actual Behavior

A single worker receives and processes the task, as shown in the logs below:

▶ celery -A distributed worker -B -l info -O fair -Q broadcast_tasks -E

/Users/lzfelix/miniconda3/envs/exp/lib/python3.6/site-packages/celery/backends/amqp.py:67: CPendingDeprecationWarning:
The AMQP result backend is scheduled for deprecation in version 4.0 and removal in version v5.0. Please use RPC backend or a persistent backend.

alternative='Please use RPC backend or a persistent backend.')

celery@Luizs-MacBook-Pro-2.local v4.3.0 (rhubarb)

Darwin-18.7.0-x86_64-i386-64bit 2019-10-07 13:23:47

[config]
.> app: src:0x103dc2080
.> transport: amqp://guest:**@localhost:5672//
.> results: amqp://
.> concurrency: 4 (prefork)
.> task events: ON

[queues]
.> bcast.53946961-33a7-4976-bf9f-d68584f8900c exchange=broadcast_tasks(fanout) key=celery

[tasks]
. distributed.tasks.perform_some_task
. distributed.tasks.reload_cache

[2019-10-07 13:23:47,812: INFO/Beat] beat: Starting...
[2019-10-07 13:23:47,822: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//
[2019-10-07 13:23:47,839: INFO/MainProcess] mingle: searching for neighbors
[2019-10-07 13:23:48,868: INFO/MainProcess] mingle: all alone
[2019-10-07 13:23:48,911: INFO/MainProcess] celery@Luizs-MacBook-Pro-2.local ready.
[2019-10-07 13:23:52,045: INFO/MainProcess] Received task: distributed.tasks.reload_cache[bb7d34df-2d6b-4543-a661-1734809d6bda]
[2019-10-07 13:23:52,049: WARNING/ForkPoolWorker-3] hi
[2019-10-07 13:23:54,051: WARNING/ForkPoolWorker-3] bye
[2019-10-07 13:23:54,083: INFO/ForkPoolWorker-3] Task distributed.tasks.reload_cache[bb7d34df-2d6b-4543-a661-1734809d6bda] succeeded in 2.034787824999512s: None