Add auto lock renewal for azure service bus channel#2446
Add auto lock renewal for azure service bus channel#2446tuschla wants to merge 21 commits intocelery:mainfrom
Conversation
for more information, see https://pre-commit.ci
|
thanks for reviving it |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2446 +/- ##
==========================================
+ Coverage 82.42% 82.56% +0.13%
==========================================
Files 79 79
Lines 10175 10192 +17
Branches 1169 1172 +3
==========================================
+ Hits 8387 8415 +28
+ Misses 1583 1573 -10
+ Partials 205 204 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
This pull request adds automatic lock renewal functionality for Azure Service Bus channels, which helps prevent messages from being re-queued when processing takes longer than the lock timeout.
Changes:
- Added support for automatic lock renewal via the Azure SDK's AutoLockRenewer class
- Introduced two new transport options:
use_lock_renewalandmax_lock_renewal_duration - Added comprehensive tests for the new functionality
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| kombu/transport/azureservicebus.py | Added AutoLockRenewer import, new transport options with defaults, renewer lifecycle management in _get_asb_receiver and close methods, and cached properties for configuration |
| t/unit/transport/test_azureservicebus.py | Added three new tests: config initialization, receiver logic with renewer creation/reuse, and safe channel closure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| default_retry_backoff_factor: float = 0.8 | ||
| # Max time to backoff (is the default from service bus repo) | ||
| default_retry_backoff_max: int = 120 | ||
| #: .. versionadded:: 5.7 |
There was a problem hiding this comment.
I am not sure If this is the right place to add the versionadded annotation here
This was already proposed here but never finalized. I added some tests as requested previously. Please let me know if you still require me to change something, so we can get this merged quicker this time around.
closing #1788