-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Request
Add support for cancelling compression jobs. Currently, the compression scheduler does not handle job cancellation requests, meaning users cannot stop a running or pending compression job gracefully. This is essential for resource management, allowing users to terminate accidental or lower-priority jobs to free up resources for other tasks.
Possible implementation
-
Update Database Schemas/Constants:
- Add
CANCELLINGandCANCELLEDstates toCompressionJobStatusinconstants.py. - Add
CANCELLEDstate toCompressionTaskStatus.
- Add
-
Update Task Managers:
- Add a
cancel()method to the abstractTaskManagerinterface. - Implement
cancel()inCeleryTaskManagerusingcelery_result.revoke(terminate=True). - Implement
cancel()inSpiderTaskManager.
- Add a
-
Update Compression Scheduler:
- Implement a
fetch_cancelling_jobsfunction to query jobs in theCANCELLINGstate. - Implement
handle_cancelling_jobslogic in the main scheduler loop:- Identify active jobs that are marked as
CANCELLING. - Call
job.result_handle.cancel()to revoke dispatched tasks. - Update status of
RUNNINGandPENDINGtasks toCANCELLEDin the database. - Update the job status to
CANCELLEDand record the final duration.
- Identify active jobs that are marked as
- Implement a
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request