spring-projects / spring-projects/spring-batch
SingleItemPeekableItemReader repeated peek issue with reader exceptions [BATCH-2370]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 2.5k
- Avg merge
- 6d 53m
- Merged PRs (30d)
- 3
Description
Tommy opened BATCH-2370 and commented
The SingleItemPeekableItemReader behaves unexpectedly on repeated peek operation, if the underlying reader threw an exception. Repeated peek operation moves the record pointer by invoking read on the delegate, because no valid next item could be stored previously.
Probably it would be reasonable to additionally store the exception in peek, and emmit it over and over, as long no read operation will be invoked.
The reader should also respect such previously stored exception and emmit it if set by the read-ahead peek operation.
Affects: 3.0.3
Attachments:
- SingleItemPeekableItemReader.java (5.32 kB)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the attached SingleItemPeekableItemReader.java and trace how repeated peek calls behave when the delegate reader throws an exception. Reproduce the case with a reader exception, then verify that repeated peeks re-emit the stored exception without advancing the record pointer until a read operation occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100