code: public void cancel() {
      DistributeJobMonitor jobMonitor = getJobMonitor();
      if (jobMonitor != null) {
        synchronized (GobblinHelixDistributeJobExecutionLauncher.this.cancellationRequest) {
          if (GobblinHelixDistributeJobExecutionLauncher.this.cancellationRequested) {
            // Return immediately if a cancellation has already been requested
            return;
          }
          GobblinHelixDistributeJobExecutionLauncher.this.cancellationRequested = true;
        }
        jobMonitor.cancel(true);
        GobblinHelixDistributeJobExecutionLauncher.this.cancellationExecuted = true;
      }
    }
docs: This method calls the underlying {@link DistributeJobMonitor}'s cancel method.
  It uses a conditional variable {@link GobblinHelixDistributeJobExecutionLauncher#cancellationRequest}
  and a flag {@link GobblinHelixDistributeJobExecutionLauncher#cancellationRequested} to avoid double cancellation.