@Override
  public boolean cancel(ExternalSystemTaskNotificationListener @NotNull ... listeners) {
    var currentTaskState = getState();
    if (currentTaskState.isStopped()) {
      return true;
    }
    if (!compareAndSetState(currentTaskState, ExternalSystemTaskState.CANCELING)) {
      return false;
    }
    try {
      addProgressListeners(listeners);
      return withCancellationProgressManager(() -> {
        return doCancel();
      });
    }
    catch (NotSupportedException e) {
      setState(ExternalSystemTaskState.CANCELLATION_FAILED);
      showCancellationFailedNotification(e);
    }
    catch (Throwable e) {
      setState(ExternalSystemTaskState.CANCELLATION_FAILED);
      myError.set(e);
      LOG.warn(e);
    }
    return false;
  }
@Override
  public boolean cancel(ExternalSystemTaskNotificationListener @NotNull ... listeners)