Skip to content

Add auto lock renewal for azure service bus channel#2446

Open
tuschla wants to merge 20 commits intocelery:mainfrom
tuschla:main
Open

Add auto lock renewal for azure service bus channel#2446
tuschla wants to merge 20 commits intocelery:mainfrom
tuschla:main

Conversation

@tuschla
Copy link
Copy Markdown

@tuschla tuschla commented Jan 22, 2026

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

@auvipy
Copy link
Copy Markdown
Member

auvipy commented Jan 22, 2026

thanks for reviving it

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.51%. Comparing base (5ef76b7) to head (2f0a049).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
kombu/transport/azureservicebus.py 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2446      +/-   ##
==========================================
+ Coverage   82.37%   82.51%   +0.13%     
==========================================
  Files          79       79              
  Lines       10116    10133      +17     
  Branches     1159     1162       +3     
==========================================
+ Hits         8333     8361      +28     
+ Misses       1580     1570      -10     
+ Partials      203      202       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_renewal and max_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.

Comment thread kombu/transport/azureservicebus.py Outdated
Comment thread kombu/transport/azureservicebus.py Outdated
Comment thread t/unit/transport/test_azureservicebus.py Outdated
Comment thread t/unit/transport/test_azureservicebus.py
tuschla and others added 3 commits January 22, 2026 12:02
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>
@auvipy auvipy added this to the 5.7.0 milestone Jan 22, 2026
Comment thread kombu/transport/azureservicebus.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread t/unit/transport/test_azureservicebus.py Outdated
auvipy and others added 3 commits March 25, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants