code: public WSStartupRecoveryServiceImpl recoverLocalPartitionsInInflightStates() {
          String methodName = "recoverLocalPartitionsInInflightStates";
  
          try {
              List<RemotablePartitionEntity> remotablePartitions = persistenceManagerService.getPartitionsRunningLocalToServer(psu);
  
              for (RemotablePartitionEntity partition : remotablePartitions) {
  
                  StepThreadExecutionEntity stepExecution = partition.getStepExecution();
                  RemotablePartitionKey key = new RemotablePartitionKey(stepExecution);
                  String newExitStatus = stepExecution.getExitStatus();
                  if (newExitStatus == null) {
                      newExitStatus = BatchStatus.FAILED.name();
                  }
  
                  if (logger.isLoggable(Level.FINE)) {
                      logger.fine(methodName + ": marking [partition = " + key + ",old batchStatus=" + stepExecution.getBatchStatus().name()
                                  + " to new batchStatus=FAILED, new exitStatus=" + newExitStatus + "]");
                  }
  
                  // The world is a more orderly place with these two timestamp values showing the same!
                  Date markFailedTime = new Date();
                  try {
                      persistenceManagerService.updateStepExecutionOnRecovery(psu, stepExecution.getStepExecutionId(), BatchStatus.FAILED, newExitStatus, markFailedTime);
                      persistenceManagerService.updateRemotablePartitionOnRecovery(psu, partition);
                  } catch (Exception updateExc) {
                      logger.log(Level.WARNING, "partition.recovery.failed", new Object[] { key, updateExc });
                  }
              }
          } catch (Exception exception) {
              logger.log(Level.WARNING, "recovery.failed", exception);
          }
  
          return this;
      }
docs: Look in the db for any partitions that this server executed with batch status of STARTING, STARTED, STOPPING
  If we are starting up, and we already have jobs in on of the state above,
  meaning those jobs did not finish when something happened to the server (jvm down, hang, etc)
  Reset all those jobs to have batch status = exit status = FAILED