mher / flower

Real-time monitor and web admin for Celery distributed task queue

Home Page:https://flower.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redis message queue: when transport option global-prefix is used, broker LLEN queries incorrect redis list

timrichardson opened this issue · comments

Describe the bug
The broker view in flower has a statistic messages (length of messages not yet sent to tasks). This is a very interesting statistic to show that the worker pool has a backlog.

If

CELERY_BROKER_TRANSPORT_OPTIONS = {'global_keyprefix': "foo-" }

and if the Celery queue name is "bar"
then the query should be
LLEN "foo-bar"

but instead, flower is doing

LLEN "bar"

which does not exist and always return 0.

I think the transport prefix should be appended to the LLEN call for the redis backend in utils/broker.py