-
Notifications
You must be signed in to change notification settings - Fork 30
✨ Enhance task cancellation #7565
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
✨ Enhance task cancellation #7565
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7565 +/- ##
==========================================
- Coverage 87.67% 84.44% -3.24%
==========================================
Files 1774 758 -1016
Lines 68409 35266 -33143
Branches 1125 170 -955
==========================================
- Hits 59979 29781 -30198
+ Misses 8121 5427 -2694
+ Partials 309 58 -251
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…rt-data-tasks-once-really-consumed
… github.com:giancarloromeo/osparc-simcore into is7563/clean-export-data-tasks-once-really-consumed
… github.com:giancarloromeo/osparc-simcore into is7563/clean-export-data-tasks-once-really-consumed
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.
👍
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.
Maybe the tests should also reflect your change. I mean they should check that when cancelling and aborigine the task the task is removed from the system
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 improves the task cancellation mechanism by renaming endpoints, functions, and tests from "abort" to "cancel" to better reflect their semantics.
- Renames API endpoints and route names from “abort_async_job” to “cancel_async_job”.
- Updates corresponding function names and test cases to use “cancel” terminology.
- Revises internal client logic to ensure tasks are cancelled and untracked correctly.
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
services/web/server/tests/unit/with_dbs/01/storage/test_storage.py | Renamed the test function to match updated cancellation terminology. |
services/web/server/src/simcore_service_webserver/tasks/_rest.py | Updated route name and URL composition for task cancellation. |
services/web/server/src/simcore_service_webserver/storage/_rest.py | Changed endpoint reference from abort to cancel. |
services/storage/tests/unit/test_modules_celery.py | Updated test names and function calls for task cancellation. |
services/storage/tests/unit/test_async_jobs.py | Adjusted test for task cancellation and cleanup. |
services/storage/src/simcore_service_storage/modules/celery/client.py | Revised task cancellation logic and renamed internal store variable. |
services/storage/src/simcore_service_storage/modules/celery/_task.py | Added a call to forget the task result once cancellation is confirmed. |
services/storage/src/simcore_service_storage/api/rpc/_async_jobs.py | Updated RPC call to use cancel task. |
api/specs/web-server/_long_running_tasks.py | Renamed exposed function for task cancellation. |
Files not reviewed (2)
- .github/CODEOWNERS: Language not supported
- services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml: Language not supported
Comments suppressed due to low confidence (2)
services/web/server/src/simcore_service_webserver/tasks/_rest.py:90
- Ensure that the endpoint renaming from 'abort_async_job' to 'cancel_async_job' is consistently reflected across all services and related documentation.
abort_href=f"{request.url.with_path(str(request.app.router['cancel_async_job'].url_for(task_id=str(job.job_id))))}"
services/storage/src/simcore_service_storage/modules/celery/client.py:72
- [nitpick] Consider renaming '_abort_task' to '_cancel_task' to maintain naming consistency with the public 'cancel_task' method.
def _abort_task(self, task_id: TaskID) -> None:
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.
Thank you
@Mergifyio queue |
🟠 Waiting for conditions to match
|
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.
There seems to be quite a confusion between cancel and abort. Can you explain when you use one or the other please?
Now it's a whole mixture. Maybe choose one and keep it.
We have both, see the description please.
Let's discuss offline tomorrow, if you still have doubts. |
|
What do these changes do?
This PR revisits the concept of task cancellation (from user's point of view).
When a
DELETE /tasks/{task_id}
is sent, the system checks if the task is still not done and in that case it aborts it. It deletes ("untracks" it) in any case.This fits also with the changes done in #7567.
Related issue/s
export_data
tasks once their result is really consumed #7563How to test
Dev-ops checklist