spring-projects / spring-projects/spring-batch
Job operator restart failed step issue
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 2.5k
- Avg merge
- 6d 53m
- Merged PRs (30d)
- 3
Description
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 :
- Status - completed , exitstatus - completed
- Status - failed , exitstatus - failed
- Status - completed , exitstatus - completed
- 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 :
- Status - completed , exitstatus - completed
- Status - failed , exitstatus - failed
- Status - failed , exitstatus - failed
- 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
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
Reproduce the issue with the described four-step Spring Batch job on Spring Batch 5.1.2 and Java 17, including the cases where steps 3 and 4 are marked completed or failed. Inspect restart behavior and step execution state around the failed second step. Done means a restart reruns the actual failed step rather than skipping it or running only the last failed step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100