RESOLVED - issue BATCH-529: StepExecutionListener.afterStep() should only be called on success
RESOLVED - issue BATCH-532: StepExecutionListener can influence exit status but not status of step execution listener.afterStep() call moved from catch block to the end of the try block
This commit is contained in:
@@ -350,6 +350,8 @@ public class ItemOrientedStep extends AbstractStep {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
status = status.and(listener.afterStep(stepExecution));
|
||||
|
||||
fatalException.setException(updateStatus(stepExecution, BatchStatus.COMPLETED));
|
||||
}
|
||||
@@ -371,13 +373,6 @@ public class ItemOrientedStep extends AbstractStep {
|
||||
}
|
||||
finally {
|
||||
|
||||
try {
|
||||
status = status.and(listener.afterStep(stepExecution));
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
logger.error("Unexpected error in listener after step.", e);
|
||||
}
|
||||
|
||||
stepExecution.setExitStatus(status);
|
||||
stepExecution.setEndTime(new Date(System.currentTimeMillis()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user