code: public void onResourceStatusMessage(final ResourceStatusEvent resourceStatusEvent) {
  
      synchronized (this.evaluatorDescriptor) {
  
        final State state = resourceStatusEvent.getState();
        LOG.log(Level.FINEST, "Resource manager state update: {0}", state);
  
        if (!this.stateManager.isAvailable()) {
  
          LOG.log(Level.FINE,
              "Ignoring resource status update for Evaluator {0} which is already in state {1}.",
              new Object[] {this.getId(), this.stateManager});
  
        } else if (state.isCompleted() && this.stateManager.isAvailable()) {
  
          // Something is wrong. The resource manager reports that the Evaluator is done or failed,
          // but the Driver assumes it to be alive.
          final StringBuilder messageBuilder = new StringBuilder("Evaluator [")
              .append(this.evaluatorId)
              .append("] is assumed to be in state [")
              .append(this.stateManager.toString())
              .append("]. But the resource manager reports it to be in state [")
              .append(state)
              .append("].");
  
          if (this.stateManager.isSubmitted()) {
            messageBuilder
                .append(" This most likely means that the Evaluator suffered a failure before establishing " +
                    "a communications link to the driver.");
          } else if (this.stateManager.isAllocated()) {
            messageBuilder.append(" This most likely means that the Evaluator suffered a failure before being used.");
          } else if (this.stateManager.isRunning()) {
            messageBuilder.append(" This means that the Evaluator failed but wasn't able to send an error message " +
                "back to the driver.");
          }
  
          if (this.task.isPresent()) {
            messageBuilder.append(" Task [")
                .append(this.task.get().getId())
                .append("] was running when the Evaluator crashed.");
          }
  
          if (resourceStatusEvent.getState() == State.KILLED) {
            this.onEvaluatorException(
                new EvaluatorKilledByResourceManagerException(this.evaluatorId, messageBuilder.toString()));
          } else {
            this.onEvaluatorException(new EvaluatorException(this.evaluatorId, messageBuilder.toString()));
          }
        }
      }
    }
docs: Resource status information from the (actual) resource manager.