Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25996

Add a REST enpoint to abort a command

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.3
    • Component/s: Bulk

      Description

      The use cases are:

      • abort a very long command run by mistake
      • abort a command that is in error and that blocks other commands on the same action

      A command in error is a possible case when:

      • The action doesn't respect their contract:
        • stop on an error that should be expected (like the user doesn't have enough permission)
        • doesn't validate its parameters and invalid input generates an error
        • don't report enough processed documents and stay in running state (this is not a blocking case)
      • The KV store has been flushed and action and status computation cannot found command or status.

      Being able to cancel a command providing its identifier will enable to recover from such situation.

      Possible implementation:

      • a bulk service abort method will set the status of the command to something like ABORTED
      • AbstractBulkComputation when not able to retrieve the command will check its status, in case of abort we skip the record instead of terminating in error
      • BulkStatusComputation will simply ignore record with the ABORTED status
      • the bulk service await should return true on aborted command

      Depending on when the command has been aborted, we can have:

      • a completed command because the abort is receive after the completion
      • a complete cancelation of the command if the action has not been applied on any document
      • a partial command where a part of the document set has been processed

      The status is written to the done stream as way to give feedback on downstream processing.

      A possible rest endpoint can be:

      curl -s -X PUT "http://localhost:8080/nuxeo/api/v1/bulk/$commandId/abort"  -u Administrator:Administrator  -H 'content-type: application/json' 
      # returns the status so we know if the command has been ABORTED or if it is already COMPLETED
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day
                  1d