-
Notifications
You must be signed in to change notification settings - Fork 32
Labels
High Prioritya totally crucial bug/feature to be fixed asapa totally crucial bug/feature to be fixed asapa:services-libraryissues on packages/service-libsissues on packages/service-libs
Milestone
Description
When handling long-running tasks, calling get_task_result has become noticeably slower. The root cause is that this function blocks until remove_task completes (due to wait_for_removal=True).
SEE LRT: create (1), inspect x2 (2) and result (3)

Why is wait_for_removal=True used?
This option was introduced to preserve the pre-refactor behavior of the LRT module (before RPC integration and related changes).
How to restore performance?
To make get_task_result faster, we should run with wait_for_removal=False. However, this requires adjustments to ensure safety:

-
Redefine
mark_task_for_removal: Once a task is marked for removal, theTasksManagerAPI should treat it as gone.- Calls like
listorgetmust not return that task. - Conceptually, marking a task for removal should move it to โtrash,โ making it inaccessible while the actual cleanup completes in the background.
- Calls like
With this approach, we can safely use wait_for_removal=False without risking inconsistent access to partially removed tasks.
odeimaiz
Metadata
Metadata
Assignees
Labels
High Prioritya totally crucial bug/feature to be fixed asapa totally crucial bug/feature to be fixed asapa:services-libraryissues on packages/service-libsissues on packages/service-libs