BATCH-2630 - Infinite loop on job restart when step was repeated

Bug fix:  use step execution ID as tie breaker when start time is identical
This commit is contained in:
Cameron
2017-07-12 15:25:29 -04:00
parent dacfe0b350
commit 1b35bff3ec

View File

@@ -229,7 +229,9 @@ public class SimpleJobRepository implements JobRepository {
if (latest == null) {
latest = stepExecution;
}
if (latest.getStartTime().getTime() < stepExecution.getStartTime().getTime()) {
// Ordered by step execution ID so less than or equal makes last step execution ID
// the tie breaker if start time is identical
if (latest.getStartTime().getTime() <= stepExecution.getStartTime().getTime()) {
latest = stepExecution;
}
}