Skip to content

Conversation

@oliverhaas
Copy link
Contributor

@auvipy auvipy requested review from auvipy and Copilot November 4, 2025 12:15
Copy link
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 PR adds functionality to automatically clear the global event loop reference when a Hub instance is closed, preventing potential issues with dangling references. The implementation ensures that only the Hub that is currently set as the global event loop gets cleared when closed.

Key Changes

  • Modified Hub.close() to clear the global event loop variable if the closing hub is the current loop
  • Added two new test cases to verify the behavior: one for clearing when the hub is current, another for not clearing when a different hub is current

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
kombu/asynchronous/hub.py Added logic in close() method to clear global _current_loop if it matches the closing hub instance
t/unit/asynchronous/test_hub.py Added two test cases to verify the new global event loop cleanup behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.16%. Comparing base (4e74395) to head (e816ee7).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2404   +/-   ##
=======================================
  Coverage   81.15%   81.16%           
=======================================
  Files          77       77           
  Lines        9717     9719    +2     
  Branches     1094     1095    +1     
=======================================
+ Hits         7886     7888    +2     
  Misses       1625     1625           
  Partials      206      206           

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

@oliverhaas
Copy link
Contributor Author

Will do the linter stuff when I'm home.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

please also fix the lint errors

@auvipy auvipy added this to the 5.6.x milestone Nov 4, 2025
@auvipy auvipy requested a review from Copilot November 4, 2025 13:45
Copy link
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.

@auvipy auvipy merged commit ecbb733 into celery:main Nov 4, 2025
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants