Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partitioned step is not re-executed when Exception was thrown in Partitioner #4736

Open
sbklahr opened this issue Dec 20, 2024 · 0 comments
Open
Labels
status: waiting-for-triage Issues that we did not analyse yet type: bug

Comments

@sbklahr
Copy link

sbklahr commented Dec 20, 2024

Bug description

A partitioned Step fails if an Exception is thrown from Partitioner.partition(). On retry Partitioner.partition() does not throw an exception and returns a valid partition map, but the partitioned Step does not run.

Environment
Spring Batch 5.1.2

Steps to reproduce

Define a partitioned step like this:

return new StepBuilder("partitionStep", jobRepository)
                .partitioner("myPartitioner", myPartitioner)
                .step(myStep)
                .gridSize(10)
                .build();

Implement a custom myPartitioner. It is possible that an Exception ist thrown from its partition() method.

After the retry the contents of BATCH_STEP_EXECUTION looks like this

  • STEP_NAME: partitionStep, JOB_EXECUTION_ID: 1, EXIT_CODE: FAILED
  • STEP_NAME: partitionStep, JOB_EXECUTION_ID: 2, EXIT_CODE: COMPLETED

Expected behavior
myStep should be executed on retry. After the retry the contents of BATCH_STEP_EXECUTION should look like this

  • STEP_NAME: partitionStep, JOB_EXECUTION_ID: 1, EXIT_CODE: FAILED
  • STEP_NAME: partitionStep, JOB_EXECUTION_ID: 2, EXIT_CODE: COMPLETED
  • STEP_NAME: myStep:partition-0, JOB_EXECUTION_ID: 2, EXIT_CODE: COMPLETED
  • STEP_NAME: myStep:partition-1, JOB_EXECUTION_ID: 2, EXIT_CODE: COMPLETED
  • ...
@sbklahr sbklahr added status: waiting-for-triage Issues that we did not analyse yet type: bug labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage Issues that we did not analyse yet type: bug
Projects
None yet
Development

No branches or pull requests

1 participant