code: protected void startCancellationExecutor() {
      this.cancellationExecutor.execute(new Runnable() {
        @Override
        public void run() {
          synchronized (AbstractJobLauncher.this.cancellationRequest) {
            try {
              while (!AbstractJobLauncher.this.cancellationRequested) {
                // Wait for a cancellation request to arrive
                AbstractJobLauncher.this.cancellationRequest.wait();
              }
              LOG.info("Cancellation has been requested for job " + AbstractJobLauncher.this.jobContext.getJobId());
              executeCancellation();
              LOG.info("Cancellation has been executed for job " + AbstractJobLauncher.this.jobContext.getJobId());
            } catch (InterruptedException ie) {
              Thread.currentThread().interrupt();
            }
          }
  
          synchronized (AbstractJobLauncher.this.cancellationExecution) {
            AbstractJobLauncher.this.cancellationExecuted = true;
            AbstractJobLauncher.this.jobContext.getJobState().setState(JobState.RunningState.CANCELLED);
            // Notify that the cancellation has been executed
            AbstractJobLauncher.this.cancellationExecution.notifyAll();
          }
        }
      });
    }
docs: Start the scheduled executor for executing job cancellation.
  
  <p>
  The executor, upon started, waits on the condition variable indicating a cancellation is requested,
  i.e., it waits for a cancellation request to arrive. If a cancellation is requested, the executor
  is unblocked and calls {@link #executeCancellation()} to execute the cancellation. Upon completion
  of the cancellation execution, the executor notifies the caller that requested the cancellation on
  the conditional variable indicating the cancellation has been executed so the caller is unblocked.
  Upon successful execution of the cancellation, it sets the job state to
  {@link JobState.RunningState#CANCELLED}.
  </p>