RESOLVED - issue BATCH-1171: Interrupted step does not fail job.

Added check for STOPPED status in AbstractJob.
This commit is contained in:
dsyer
2009-03-23 10:52:55 +00:00
parent 6b1e440a67
commit 56de18f884
7 changed files with 213 additions and 27 deletions

View File

@@ -254,7 +254,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware, In
// The job was already stopped before we even got this far. Deal
// with it in the same way as any other interruption.
execution.setStatus(BatchStatus.FAILED);
execution.setStatus(BatchStatus.STOPPED);
execution.setExitStatus(ExitStatus.COMPLETED);
}
@@ -346,7 +346,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware, In
jobRepository.updateExecutionContext(execution);
if (currentStepExecution.getStatus() == BatchStatus.STOPPING) {
if (currentStepExecution.getStatus() == BatchStatus.STOPPING || currentStepExecution.getStatus() == BatchStatus.STOPPED) {
throw new JobInterruptedException("Job interrupted by step execution");
}