code: @Override
    public void launchTask(final ExecutorDriver executorDriver, final Protos.TaskInfo taskInfo) {
      final String taskId = taskInfo.getTaskId().getValue();
  
      LOG.info("Asked to launch task {}", taskId);
  
      try {
        final ch.qos.logback.classic.Logger taskLog = taskBuilder.buildTaskLogger(taskId, taskInfo.getExecutor().getExecutorId().getValue());
        final SingularityExecutorTask task = taskBuilder.buildTask(taskId, executorDriver, taskInfo, taskLog);
  
        SubmitState submitState = monitor.submit(task);
  
        switch (submitState) {
          case REJECTED:
            LOG.warn("Can't launch task {}, it was rejected (probably due to shutdown)", taskInfo);
            break;
          case TASK_ALREADY_EXISTED:
            LOG.error("Can't launch task {}, already had a task with that ID", taskInfo);
            break;
          case SUBMITTED:
            task.getLog().info("Launched task {} with data {}", taskId, task.getExecutorData());
            break;
        }
  
      } catch (Throwable t) {
        LOG.error("Unexpected exception starting task {}", taskId, t);
  
        executorUtils.sendStatusUpdate(executorDriver, taskInfo.getTaskId(), TaskState.TASK_LOST, String.format("Unexpected exception while launching task %s - %s", taskId, t.getMessage()), LOG);
      }
    }
docs: Invoked when a task has been launched on this executor (initiated
  via Scheduler::launchTasks). Note that this task can be realized
  with a thread, a process, or some simple computation, however, no
  other callbacks will be invoked on this executor until this
  callback has returned.