Defer _reset_cycle call until after updating _active_queue - #2553
Conversation
auvipy
left a comment
There was a problem hiding this comment.
this will also need proper tests
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2553 +/- ##
=======================================
Coverage 82.75% 82.75%
=======================================
Files 79 79
Lines 10261 10261
Branches 1174 1174
=======================================
Hits 8491 8491
Misses 1569 1569
Partials 201 201 ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the virtual transport Channel.basic_cancel() flow so that _reset_cycle() rebuilds the FairCycle using the updated _active_queues list (after the queue is removed), matching how _reset_cycle() derives its resources.
Changes:
- Moved the
_reset_cycle()call inbasic_cancel()to occur after_active_queues.remove(queue). - Updated the corresponding unit test to validate the intended ordering behavior around
_active_queuesupdates and_reset_cycle().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
kombu/transport/virtual/base.py |
Defers _reset_cycle() until after _active_queues is updated during basic_cancel(). |
t/unit/transport/virtual/test_base.py |
Adjusts the unit test for basic_cancel() to check the new call ordering expectations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
_reset_cyclewhen called updates_cyclewith a newFairCyclebased on the value ofactive_queues.This means we should call
_reset_cycleafter we remove the queue from_active_queuesinstead of before that.