spring-projects / spring-projects/spring-batch

SimpleJobLauncher parameter validation and JobExecutionListener [BATCH-2375]

Open
#1,229 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

has: minimal-example in: core status: waiting-for-reporter status: waiting-for-triage type: bug
Dominant language
Java
Stars
3k
Forks
2.5k
Avg merge
6d 53m
Merged PRs (30d)
3

Description

Sandor Nemeth opened BATCH-2375 and commented

When execution jobs with the SimpleJobLauncher, the validation of the parameters happens without regard to the set JobExecutionListeners. However the same call to the same JobParametersValidator is handled (at least regarding to the JobExecutionListener#afterJob(JobExecution jobExecution) call) properly in the AbstractJob class.

I have attached the minimal case to reproduce the scenario. Simply run mvn spring-boot:run to run the application. The expected outcome is to see at least the "after job" message in the console.

Priority is set to major, because there are business scenarios that can be affected by this behaviour (e.g. when developing a completely automatic import process where if the import fails, the process should be completely stopped (the system should not be able to start a new process in this case)).
Please redefine the priority if you think otherwise.


Affects: 3.0.3

Attachments:

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

Run the attached joblistener.zip reproduction with mvn spring-boot:run and confirm the expected console output. Then read the SimpleJobLauncher and AbstractJob execution paths, focusing on parameter validation and JobExecutionListener callbacks; done means the reproduced failure emits the after job message.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.