-
Notifications
You must be signed in to change notification settings - Fork 32
🐛 Ensure proper Redis client shutdown in Celery #8237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Ensure proper Redis client shutdown in Celery #8237
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8237 +/- ##
==========================================
- Coverage 87.81% 87.66% -0.15%
==========================================
Files 1945 1529 -416
Lines 75564 63341 -12223
Branches 1314 686 -628
==========================================
- Hits 66354 55526 -10828
+ Misses 8813 7573 -1240
+ Partials 397 242 -155
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
🧪 CI InsightsHere's what we observed from your CI run for faa5549. ✅ Passed Jobs With Interesting Signals
|
There was a problem hiding this 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 fixes a critical issue with Celery's Redis client lifecycle management where Redis connections were not properly cleaned up, leading to resource leaks. The fix ensures proper initialization and shutdown of Redis clients throughout the application.
- Centralizes Redis client lifecycle management for Celery operations
- Refactors worker initialization to remove redundant celery_settings parameter
- Updates method names for consistency (lifespan → start_and_hold)
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
services/storage/src/simcore_service_storage/modules/celery/__init__.py |
Complete refactor to manage Redis client lifecycle with proper setup/shutdown |
services/storage/src/simcore_service_storage/core/application.py |
Updated to use new setup_celery function name and reorganized conditional logic |
packages/service-library/src/servicelib/fastapi/celery/app_server.py |
Added task_manager property and renamed lifespan method to start_and_hold |
packages/service-library/src/servicelib/celery/app_server.py |
Made task_manager abstract property and renamed lifespan method |
packages/celery-library/src/celery_library/signals.py |
Simplified worker initialization by removing redundant celery_settings parameter |
packages/celery-library/src/celery_library/common.py |
Removed create_task_manager function that was causing lifecycle issues |
services/storage/tests/conftest.py |
Updated test fixture to match simplified worker initialization |
packages/celery-library/tests/conftest.py |
Updated test fixtures with proper Redis client lifecycle management |
packages/service-library/src/servicelib/celery/models.py |
Fixed parameter name from task_context to task_filter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. Thanks
services/storage/src/simcore_service_storage/modules/celery/__init__.py
Outdated
Show resolved
Hide resolved
services/storage/src/simcore_service_storage/core/application.py
Outdated
Show resolved
Hide resolved
…rloromeo/osparc-simcore into is8159/fix-redis-client-lifecycle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx!
…rloromeo/osparc-simcore into is8159/fix-redis-client-lifecycle
@Mergifyio queue |
🛑 Configuration not compatible with a branch protection settingThe branch protection setting |
|
ae14233
into
ITISFoundation:master
What do these changes do?
This PR fixes a critical issue with Celery's Redis client lifecycle management where Redis connections were not properly cleaned up, leading to resource leaks. The fix ensures proper initialization and shutdown of Redis clients throughout the application.
Related issue/s
How to test
Dev-ops