code: protected void markStepForFailure() {
          StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse
          synchronized (stopLock) {
              updateStepBatchStatus(BatchStatus.FAILED);
              if (!issuedFailureMessageToJobLog) {
                  stepThreadHelper.logFailedMessage();
                  issuedFailureMessageToJobLog = true;
              }
          }
      }
docs: Updates in-memory status and issues message to job log, but does not persist final status.
  
  Possible this routine gets called more than once, e.g. we might fail during normal step
  execution, then also fail in afterStep().