code: func (e *engineImpl) abortInvocation(c context.Context, jobID string, invID int64) error {
  	return e.withController(c, jobID, invID, "manual abort", func(c context.Context, ctl *taskController) error {
  		ctl.DebugLog("Invocation is manually aborted by %s", auth.CurrentIdentity(c))
  
  		switch err := ctl.manager.AbortTask(c, ctl); {
  		case transient.Tag.In(err):
  			return err // ask for retry on transient errors, don't touch Invocation
  		case err != nil:
  			ctl.DebugLog("Fatal error when aborting the invocation - %s", err)
  		}
  
  		// On success or on a fatal error mark the task as aborted (unless the
  		// manager already switched the state). We can't do anything about the
  		// failed abort attempt anyway.
  		if !ctl.State().Status.Final() {
  			ctl.State().Status = task.StatusAborted
  		}
  		return nil
  	})
  }
docs: // abortInvocation marks some invocation as aborted.