Repository navigation
Closed
Labels
Milestone
Description
Checklist
- I have verified that the issue exists against the
mainbranch of Celery. - 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 main 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 reportin 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
mainbranch of Celery. - I have included the contents of
pip freezein the issue. - I have included all the versions of all the external dependencies required
to reproduce this bug.
Related Issues and Possible Duplicates
Related Issues
Possible Duplicates
- None
Environment & Settings
Celery version: 5.6.3
celery report Output:
software -> celery:5.6.3 (dawn-chorus) kombu:5.6.2 py:3.14.0
billiard:4.2.4 py-amqp:5.3.1
platform -> system:Linux arch:64bit, ELF
kernel version:***
loader -> celery.loaders.app.AppLoader
settings -> transport:amqps result:N/A
broker_url: amqps://***:***@***:5671/***
deprecated_settings: None
Steps to Reproduce
Required Dependencies
- Minimal Python Version: 3.11
- Minimal Celery Version: 5.4
- Minimal Kombu Version: 5.6.2
- Minimal Broker Version: RabbitMQ 3
- Minimal Result Backend Version: N/A
- Minimal OS and/or Kernel Version: N/A
- Minimal Broker Client Version: amqp 5.3.1
- Minimal Result Backend Client Version: N/A
Python Packages
pip freeze Output:
amqp==5.3.1
billiard==4.2.4
celery==5.6.3
click==8.3.2
click-didyoumean==0.3.1
click-plugins==1.1.1.2
click-repl==0.3.0
gevent==26.4.0
greenlet==3.4.0
kombu==5.6.2
packaging==26.1
prompt-toolkit==3.0.52
psutil==7.2.2
python-dateutil==2.9.0.post0
six==1.17.0
tzdata==2026.1
tzlocal==5.3.1
vine==5.1.0
wcwidth==0.6.0
zope-event==6.1
zope-interface==8.3
Other Dependencies
Details
Docker (for RabbitMQ container)
Minimally Reproducible Test Case
Details
uv sync
uv run python main.pyExpected Behavior
After broker reconnection, the old EventDispatcher should stop its heartbeat timer or guard against producer=None, so no objects accumulate in _outbound_buffer.
Actual Behavior
When the broker connection drops and reconnects, the old EventDispatcher's heartbeat timer keeps calling _publish() with producer=None.
try:
producer.publish(...)
except Exception as exc:
if not self.buffer_while_offline:
raise
self._outbound_buffer.append((event, routing_key, exc))producer is None, so producer.publish() raises AttributeError. _publish() catches it and appends (event, routing_key, exc) to _outbound_buffer. The exception keeps traceback/frame references alive, so they never get GC'd. This repeats every ~2s.
Activity
auvipy commentedon Apr 21, 2026
are you up for fixing this?
JaeHyuckSa commentedon Apr 21, 2026
Hello @auvipy, @Song-Junho97 is a colleague of mine working on the same project, and he has already looked into this issue in detail. He’s also interested in working on a fix, so we’re planning to take a look at it together.
auvipy commentedon Apr 21, 2026
Ok that would be great
fix(events): skip publish when producer is None
test(events): exercise public send() path in celery#10273 regression …
test(events): exercise public send() path in celery#10273 regression …
fix(events): skip publish when producer is None to stop memory leak a…
fix(events): stop leaking exceptions and cancel stale Heart timers (#…