spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

Job operator restart failed step issue

Open vatsla20 opened this issue 1 year ago • 1 comments

Bug description I have a spring batch job with eg : 4 steps, the second steps fails and the flow is such that I need to update details so it goes on to the 3rd and 4th steps marks them as complete. In the end of the job I update the job execution with status and exit status as failed and restart the job. Step execution :

  1. Status - completed , exitstatus - completed
  2. Status - failed , exitstatus - failed
  3. Status - completed , exitstatus - completed
  4. Status - completed , exitstatus - completed Job execution status failed and exit status failed

On restart non of the steps are executed again and the job ends successfully. I want to restart the job from the failed step.

Now if I try to fail the last 3 steps Step execution :

  1. Status - completed , exitstatus - completed
  2. Status - failed , exitstatus - failed
  3. Status - failed , exitstatus - failed
  4. Status - failed , exitstatus - failed Job execution status failed and exit status failed

Here only the step 4 is executed on the restart, it's taking only the last failed step. Environment Please provide as many details as possible: Spring batch version - 5.1.2 Java version 17

Steps to reproduce Given above

Expected behavior How can I make the job restart from the second step which is the actual failed step

vatsla20 avatar Aug 16 '24 06:08 vatsla20

Thank you for opening this issue. The job should restart from the first failed step (step 2 in your case). I do not exclude this to be a bug in Spring Batch, however, I would like to be able to reproduce the issue with an example.

Can you please provide a complete yet minimal example that reproduces the problem? You can start from the project template as explained in Issue Reporting Guide. Thank you upfront.

fmbenhassine avatar Sep 03 '24 09:09 fmbenhassine