I'm encountering a bug where fanout exchange messages are being mixed between Celery instances even though they are configured to use separate Redis virtual databases.
Description:
We are running two Django applications that utilize the same Redis Sentinel for task processing, but with different virtual databases. We observed unexpected behavior where workers from the first Celery instance were logging missed heartbeats from workers in the second Celery instance.
These heartbeat messages were being published to the same Redis channel, as we observed all PUBLISH commands processed by the Redis look like:
=> The channel name should ideally have a prefix reflecting the virtual database (/1.celeryev/worker.heartbeat) instead of /{db}.celeryev/worker.heartbeat
Potential Cause:
It appears the _get_pool function within the SentinelChannel class is not formatting the keyprefix_fanout variable correctly as the one in Channel:
I'm encountering a bug where fanout exchange messages are being mixed between Celery instances even though they are configured to use separate Redis virtual databases.
Description: We are running two Django applications that utilize the same Redis Sentinel for task processing, but with different virtual databases. We observed unexpected behavior where workers from the first Celery instance were logging missed heartbeats from workers in the second Celery instance.
These heartbeat messages were being published to the same Redis channel, as we observed all
PUBLISH
commands processed by the Redis look like:=> The channel name should ideally have a prefix reflecting the virtual database (
/1.celeryev/worker.heartbeat
) instead of/{db}.celeryev/worker.heartbeat
Potential Cause: It appears the
_get_pool
function within theSentinelChannel
class is not formatting thekeyprefix_fanout
variable correctly as the one inChannel
: