BATCH-1064: Switched the semantics of INCOMPLETE and FAILED. Combined INCOMPLETE with STOPPED. INCOMPLETE jobs and steps can be restarted while COMPLETED and FAILED jobs and steps cannot.
This commit is contained in:
@@ -99,11 +99,11 @@ public class ChunkMessageChannelItemWriter<T> extends StepExecutionListenerSuppo
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
logger.debug("Detected failure waiting for results in step listener.", e);
|
||||
stepExecution.setStatus(BatchStatus.FAILED);
|
||||
stepExecution.setStatus(BatchStatus.INCOMPLETE);
|
||||
return ExitStatus.FAILED.addExitDescription(e.getClass().getName() + ": " + e.getMessage());
|
||||
}
|
||||
if (timedOut) {
|
||||
stepExecution.setStatus(BatchStatus.FAILED);
|
||||
stepExecution.setStatus(BatchStatus.INCOMPLETE);
|
||||
throw new ItemStreamException("Timed out waiting for back log at end of step");
|
||||
}
|
||||
return ExitStatus.COMPLETED.addExitDescription("Waited for " + expecting + " results.");
|
||||
|
||||
@@ -27,8 +27,8 @@ import org.springframework.batch.core.JobExecution;
|
||||
* (generally a handler cannot determine if the whole job execution is complete,
|
||||
* so this is just information about the step).<br/>
|
||||
*
|
||||
* If the incoming status is {@link BatchStatus#FAILED},
|
||||
* {@link BatchStatus#STOPPED} or {@link BatchStatus#STOPPING} the request
|
||||
* If the incoming status is {@link BatchStatus#INCOMPLETE},
|
||||
* {@link BatchStatus#FAILED} or {@link BatchStatus#STOPPING} the request
|
||||
* should be ignored by handlers (passed on without modification).
|
||||
*
|
||||
* @author Dave Syer
|
||||
|
||||
@@ -136,7 +136,7 @@ public class StepExecutionMessageHandler {
|
||||
* @return
|
||||
*/
|
||||
private boolean isComplete(JobExecutionRequest request) {
|
||||
return request.getStatus() == BatchStatus.FAILED || request.getStatus() == BatchStatus.STOPPED
|
||||
return request.getStatus() == BatchStatus.INCOMPLETE || request.getStatus() == BatchStatus.FAILED
|
||||
|| request.getStatus() == BatchStatus.STOPPING;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public class StepExecutionMessageHandler {
|
||||
*/
|
||||
private void handleFailure(JobExecutionRequest request, Throwable e) {
|
||||
request.registerThrowable(e);
|
||||
request.setStatus(BatchStatus.FAILED);
|
||||
request.setStatus(BatchStatus.INCOMPLETE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user