Some submission are runnable. When a user submits a runnable submission to a queue, the queue's Submission Application would check and start the runnable process. This process could take a long time. We want to provide users the ability to stop their running process at anytime that it is running.
When a user A submits a submission B to queue C, an Submission (immutable object) and SubmissionStatus (mutable object) are created.
Queue C's Application starts the running process for submission B and update submission B's Submission Status.
Add the following fields to Submission Status:
Submission Status |
---|
currentFields |
canCancel : Boolean (Default FALSE) |
cancelRequested : Boolean (Default FALSE) |
When the queue's Application starts the running process, it would change canCancel to TRUE.
Add an API that allows user to request to cancel their submissions:
Action | Intended Users | URI | Method | Request Params | Request Body | Response Body |
---|---|---|---|---|---|---|
Request to Cancel a Submission | The user who submitted the Submission | /evaluation/submission/{subId}/cancellation | PUT | None | None | None |
When a user make such request, we will check for:
If both conditions are met, we will set the cancelRequested value to TRUE and return 200. We will throw an appropriate 400 status code for error.
The queue's Application are responsible to check for cancelRequested value and update SubmissionStatus appropriately.
Both canCancel and cancelRequested will be added to the list of Queryable Annotations. We will also add CancelControl object to this list.
CancelControl |
---|
submissionId : String |
userId : String |
canCancel : Boolean |
cancelRequested : Boolean |