Skip to content

Conversation

@JunggiKim
Copy link

Fix default skip policy when only retry is configured.

When configuring retry without skip in a fault-tolerant step, items that
fail after exhausting retry attempts are currently silently skipped instead
of failing the step, which can lead to silent data loss.

This PR changes the default SkipPolicy from AlwaysSkipItemSkipPolicy to
NeverSkipItemSkipPolicy when no skip exceptions are explicitly configured.

Changes:

  • Removed skipLimit > 0 condition from skip policy initialization
  • Updated default SkipPolicy from AlwaysSkipItemSkipPolicy to NeverSkipItemSkipPolicy
  • Updated JavaDoc to reflect the new default behavior
  • Added unit test to verify default SkipPolicy behavior

Resolves gh-5077

When retry is configured without explicit skip settings, the default
SkipPolicy should be NeverSkipItemSkipPolicy instead of
AlwaysSkipItemSkipPolicy to prevent silent data loss when items fail
after retry exhaustion.

This commit removes the `skipLimit > 0` condition from the skip policy
initialization, ensuring NeverSkipItemSkipPolicy is used when no skip
exceptions are explicitly configured via the skip() method.

Resolves spring-projectsgh-5077

Signed-off-by: kjg <kimjg2477@gmail.com>
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.

ChunkOrientedStepBuilder: Default SkipPolicy should be NeverSkipItemSkipPolicy when only retry is configured (not AlwaysSkipItemSkipPolicy)

1 participant