Repository navigation
fix(azurestoragequeues): scope queue name cache to Connection - #2679
Merged
auvipy merged 3 commits intoSep 30, 2026
Merged
Conversation
Channel._queue_name_cache was a class attribute, so every Azure Storage Queues channel in the process shared one dict of queue names, filled from each storage account's list_queues(). A Connection to a second storage account then trusts the first account's listing: _ensure_queue finds the name in the cache, skips create_queue, and the send fails with ResourceNotFoundError because the queue only exists in the first account. Move the cache onto the Transport, one per Connection, and expose it on Channel through a property, the same approach as celery#2543 and celery#2676.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2679 +/- ##
==========================================
+ Coverage 84.19% 84.35% +0.15%
==========================================
Files 80 80
Lines 11310 11315 +5
Branches 1354 1354
==========================================
+ Hits 9523 9545 +22
+ Misses 1567 1552 -15
+ Partials 220 218 -2 ☔ View full report in Codecov by Harness. |
auvipy
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same class-attribute sharing that #2543 fixed for Azure Service Bus and #2676 for SQS, this time in the Azure Storage Queues transport.
Channel._queue_name_cacheis a class attribute, and each channel fills it from its own storage account'slist_queues(). A Connection to a second storage account then trusts the first account's listing:_ensure_queuefinds the queue name in the cache, skipscreate_queue, and the send fails withResourceNotFoundError: The specified queue does not exist, because that queue only exists in the first account.The fix moves the cache onto
Transport(one per Connection) and exposes it onChannelthrough a property. Channels of the same Connection still share it.Testing:
test_queue_name_cache_is_not_shared_across_connections, which fails onmain(the second account never callscreate_queue) and passes with the change.ordersqueue. Onmain, sendingordersthrough the second Connection raisesResourceNotFoundError. With the change, the queue is created on the second server and the send succeeds.t/unit: 1616 passed. pre-commit hooks pass on both files._noack_queueson this channel is also a class attribute, but nothing reads it (_getdeletes every message regardless), so I left it alone to keep this focused.