Skip to content

Conversation

@JunggiKim
Copy link

This change adds proper exception handling in ChunkOrientedStep to prevent silent data loss when skip policy rejects skipping after retry exhaustion.

Changes:

  • Added else blocks in doSkipInRead(), doSkipInProcess(), and scan() methods
  • Throw appropriate NonSkippable*Exception when skipPolicy.shouldSkip() returns false
  • Added test case verifying NonSkippableProcessException is thrown

Problem:
When retry is exhausted and skipPolicy.shouldSkip() returns false, the current implementation silently discards items without throwing an exception. This causes silent data loss.

Solution:
Added else blocks to throw NonSkippableReadException, NonSkippableProcessException, or NonSkippableWriteException when skip policy rejects skipping.

Fixes gh-5079

When retry is exhausted and skipPolicy.shouldSkip() returns false,
ChunkOrientedStep should fail the job instead of silently discarding
the item. This change adds proper exception handling to prevent
silent data loss.

- Add NonSkippableReadException in doSkipInRead() else block
- Add NonSkippableProcessException in doSkipInProcess() else block
- Add NonSkippableWriteException in scan() else block
- Add test case for skip policy rejection scenario

Fixes spring-projectsgh-5079

Signed-off-by: kjg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ChunkOrientedStep does not throw exception when skipPolicy.shouldSkip() returns false

1 participant