spring-projects / spring-projects/spring-batch

batch job using param incrementer can’t be restarted anymore from command line

Open
#5,340 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-reporter
Dominant language
Java
Stars
3k
Forks
2.5k
Avg merge
6d 53m
Merged PRs (30d)
3

Description

Supersedes spring-projects/spring-boot/issues/49569 (please check spring-boot team feedback on it)

With Spring Boot 4.0.3, batches using JobParameterIncrementer can’t be restarted anymore from the command line. Instead of restarting the job instance, İt starts a new instance of the job.

Without JobParameterIncrementer, there is no such issue with restart.

Spring Batch 6 doesn’t forbid to restart a job with JobParameterIncrementer. Such a job can still be restarted as expected when using JobOperator#restart (but not with JobOperator#start()).

JobOperator seems a little inconsistent to me with Spring Batch 6 major changes around JobParameterIncrementer. I don’t know if this restart issue should be fixed on Spring Boot JobLaunchApplicationRunner or on Spring Batch side.

Here is a demo.zip to illustrate the issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the command-line path through JobLaunchApplicationRunner and compare its handling of JobOperator#start() with the working JobOperator#restart() path. Use the attached demo.zip to reproduce a restart for a job with JobParameterIncrementer, then verify that the command-line operation restarts the existing job instance rather than creating a new one.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, data-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.