Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Background

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 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:

...

  • Is the user who making the request submitted the submission?
  • Is canCancel's value for the request submission TRUE?

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.

Queryable Annotations

Both canCancel and cancelRequested will be added to the list of Queryable Annotations. We will also add Cancel Control CancelControl object to this lislist.

CancelControl
submissionId : String
canCancel : Boolean
userId : String

Service Layer

Add a new boolean field to submission status called 'cancelRequested'.

When a submission is created the value is false.

...

canCancel : Boolean
cancelRequested : Boolean

Notes:

  • Add CANCELLED as a submission status in the

...

The field is mapped to a 'public' annotation in the query table.

Anyone with permission to modify the submission status can modify the cancelRequested field as well.

A new service can be called by an authorized user to update this field:

PUT /evaluation/submission/{subId}/cancellation

If the authenticated user is the submitter of the submission indicated by the submission ID and the current state is false then it becomes true.

If the authenticated user is different from the submitter then a 403 Forbidden is returned.  

If the submission ID is invalid a 404 Not Found is returned.

To view and cancel submissions in the Synapse Portal:

Add a leaderboard widget, including an executionStatus column.  The query should use 'where userId==@CURRENT_USER' to show just the submitter's jobs.

Choose the 'stop button' renderer for this column.

The button shows "CANCEL" when the state is false.

...

  • SubmissionStatus enum.