New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
task.delay()
with Azure Service Bus throws AttributeError: 'NoneType' object has no attribute 'create_sender_link'
while sending a lot of tasks (Race condition?)
#8878
Comments
We found a workaround : Setting |
After some more testing, Setting Is there anyone else using Az Service Bus as a broker with Django and Celery? |
I am using Azure Service Bus with Django Celery and facing an error as well. A bit different tho. After an idle timeout 10 mins, when the link is detached and then the broker reconnects, the celery worker fails to pick up the tasks from the Azure service bus. So now my queue is getting enqueued with tasks but Celery is not working on it. celery==5.3.6 Terminal logs when I enqueue a task after 10 idle minutes:
These are my settings in Django: In base.py:
In celery_app.py :
In init.py:
This is the command I execute in start.sh
|
Checklist
main
branch of Celery.Tested with version "main" 5.4.0rc1 ac16f23" and 5.3.6 from pypi.
Yes, `task.delay()` is not thread-safe with kombu/azure-servicebus #8856
contribution guide
on reporting bugs.
for similar or identical bug reports.
for existing proposed fixes.
to find out if the bug was already fixed in the main branch.
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
main
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.
Tested with 5.10 and 5.11rc1
I have tried reproducing the issue on more than one message broker and/or
result backend.
Only Az Service Bus
I have tried reproducing the issue on more than one version of the message
broker and/or result backend.
No bug found with package azure-servicebus==7.8.3.
Cannot use different version of Az Service Bus (SaaS).
I have tried reproducing the issue on more than one operating system.
Ubuntu. 22.04.01 (LTS)
Docker image python:3.10-slim-bookworm
Docker image python:3.10-slim-buster
I have tried reproducing the issue on more than one workers pool.
N/A. Only affected when producing task messages
I have tried reproducing the issue with autoscaling, retries,
ETA/Countdown & rate limits disabled.
N/A
I have tried reproducing the issue after downgrading
and/or upgrading Celery and its dependencies.
testing with these combinations :
Related Issues and Possible Duplicates
Related Issues
Possible Duplicates
Environment & Settings
Celery version:
celery report
Output:Steps to Reproduce
Required Dependencies
Python Packages
pip freeze
Output:Other Dependencies
You need access to Azure Service Bus.
Minimally Reproducible Test Case
Project with a minimal Django app to reproduce the bug here https://github.com/totobest/bug-celery-az-servicebus. See included README.md.
Expected Behavior
No error
Actual Behavior
Logs
Sometimes, the error is different:
Handler failed: 'NoneType' object has no attribute 'client_ready'.
The text was updated successfully, but these errors were encountered: