code: private void sendCancelRpcCall(int numberRetries) {
  		final LogicalSlot slot = assignedResource;
  
  		if (slot != null) {
  			final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway();
  			final ComponentMainThreadExecutor jobMasterMainThreadExecutor =
  				getVertex().getExecutionGraph().getJobMasterMainThreadExecutor();
  
  			CompletableFuture<Acknowledge> cancelResultFuture = FutureUtils.retry(
  				() -> taskManagerGateway.cancelTask(attemptId, rpcTimeout),
  				numberRetries,
  				jobMasterMainThreadExecutor);
  
  			cancelResultFuture.whenComplete(
  				(ack, failure) -> {
  					if (failure != null) {
  						fail(new Exception("Task could not be canceled.", failure));
  					}
  				});
  		}
  	}
docs: This method sends a CancelTask message to the instance of the assigned slot.
  
  <p>The sending is tried up to NUM_CANCEL_CALL_TRIES times.