-
Notifications
You must be signed in to change notification settings - Fork 32
♻️ TasksManager uses Redis for task data #8131
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
♻️ TasksManager uses Redis for task data #8131
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8131 +/- ##
==========================================
- Coverage 88.07% 88.02% -0.05%
==========================================
Files 1905 1871 -34
Lines 73166 72543 -623
Branches 1280 1260 -20
==========================================
- Hits 64444 63859 -585
+ Misses 8343 8308 -35
+ Partials 379 376 -3
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…nning-tasks-refactor-6
…ning-tasks-refactor-6
…nning-tasks-refactor-6
This reverts commit 9fbf1cf.
…nning-tasks-refactor-6
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.
as agreed, please do not forget to follow up on the refactoring of background tasks. thx
matusdrobuliak66
left a comment
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.
I didn't check yet, but to unblock you I approve.
YuryHrytsuk
left a comment
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.
Do not forget to merge https://git.speag.com/oSparc/osparc-ops-deployment-configuration/-/merge_requests/1498
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 pull request refactors the TasksManager to use Redis for storing task data instead of in-memory storage, enabling better distributed task management across multiple service instances.
- Replaces in-memory task tracking with Redis-based storage for long-running tasks
- Implements task cancellation across different service instances via Redis
- Updates all services to properly configure Redis client SDK with
setup()calls
Reviewed Changes
Copilot reviewed 114 out of 115 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| services/web/server/src/simcore_service_webserver/long_running_tasks.py | Configures long running tasks with Redis settings and namespace |
| packages/service-library/src/servicelib/long_running_tasks/task.py | Major refactor to use Redis-based storage instead of in-memory tracking |
| packages/service-library/src/servicelib/redis/_client.py | Adds explicit setup() method and improves Redis health checking |
| packages/settings-library/src/settings_library/redis.py | Renames DISTRIBUTED_IDENTIFIERS database to LONG_RUNNING_TASKS |
| services/*/tests/ | Updates test configurations to use Redis for long running tasks |
Comments suppressed due to low confidence (1)
packages/service-library/src/servicelib/long_running_tasks/task.py:441
- The
_update_progressmethod is called frequently during task execution but performs Redis operations on every call. Consider implementing a debouncing mechanism or batching progress updates to reduce Redis load, especially for tasks that update progress very frequently.
except TaskNotFoundError:
services/web/server/src/simcore_service_webserver/projects/_crud_api_create.py
Show resolved
Hide resolved
packages/service-library/src/servicelib/long_running_tasks/_store/redis.py
Outdated
Show resolved
Hide resolved
|
@Mergifyio queue |
🟠 Waiting for conditions to match
|
|
|
Force merged upon @GitHK request |

What do these changes do?
While the
asyncio.Taskis still attached and tracked by a single instance of the service, its associated data is stored in Redis.This change simplifies the fowling:
Changes:
RedisClientSDKthat caused it to hang when closingdistributed_identifiersRedis DB, which is now used for thelong_running_taskslrt_apimodule. When a task is cancelled, the intent is stored in Redis. If the copy of the service, that received the message can't handle it (does not have the task), it will be removed by the background task running on all copies of the service.Related issue/s
dynamic-sidecarclient using RabbitMQ (enables easier k8s migration) #7224How to test
Dev-ops