BATCH-2442: fix infinite loop when item processor fails during a scan
Currently, when the processor throws an exception during a scan, the chunk is never marked as complete and the step never finishes. Moreover, items that were processed unsuccessfully are still written. This commit fixes the issue by excluding failed items from the scan. Resolves BATCH-2442
This commit is contained in:
@@ -580,6 +580,14 @@ public class FaultTolerantChunkProcessor<I, O> extends SimpleChunkProcessor<I, O
|
||||
Chunk<I>.ChunkIterator inputIterator = inputs.iterator();
|
||||
Chunk<O>.ChunkIterator outputIterator = outputs.iterator();
|
||||
|
||||
//BATCH-2442 : do not scan skipped items
|
||||
if (!inputs.getSkips().isEmpty()) {
|
||||
if (outputIterator.hasNext()) {
|
||||
outputIterator.remove();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
List<O> items = Collections.singletonList(outputIterator.next());
|
||||
inputIterator.next();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user