Skip to content

Conversation

@isanghaessi
Copy link
Contributor

@isanghaessi isanghaessi commented Aug 15, 2025

Summary

This PR fixes #4755 .
Problem is, job with having zero identifier job parameters are able to restart.
Job what having COMPLETED status should not be able to restart with same Job Parameters.

Changes

  • Removed exception condition for job parameters with no identifier job parameters.
  • Add test case.
  • Edit test cases made assuming empty identifying job parmaeters can be restarted.

@isanghaessi isanghaessi reopened this Aug 15, 2025
@isanghaessi isanghaessi force-pushed the GH-4755 branch 3 times, most recently from 8954563 to 0142d11 Compare August 16, 2025 09:13
@isanghaessi isanghaessi changed the title Gh 4755: Fix wrong behavior of JobRepository with empty identifying job parameters GH-4755: Fix wrong behavior of JobRepository with empty identifying job parameters Sep 4, 2025
@isanghaessi
Copy link
Contributor Author

Hi, @fmbenhassine.
Can you please review this PR when has chance?
I am very interesting spring batch project and using it.
I hope this ambigious behavior will be fixed.
Thanks.

@fmbenhassine
Copy link
Contributor

Hi @isanghaessi ,

Thank you for the PR. #4755 is planned for v6, so I will check your PR soon. I will keep you posted.

@fmbenhassine
Copy link
Contributor

I am looking into including this PR in v6.0.0-RC2 if possible. Can you please rebase it on the latest main? Thank you upfront.

@fmbenhassine fmbenhassine added the status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter label Oct 30, 2025
…ob parameters

Signed-off-by: Seungyong Hong <jesse1231@naver.com>
@fmbenhassine fmbenhassine added status: feedback-provided Issues for which the feedback requested from the reporter was provided and removed status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter labels Oct 30, 2025
@isanghaessi
Copy link
Contributor Author

Hi @fmbenhassine,
Since there were too many changes in the middle, I force pushced changes.

I moved my changes from SimpleJobRepository from TaskExecutorJobLauncher.
I saw restartability logic moved from JobRepository to JobOperator - 90d8959.

					if (!identifyingJobParameters.isEmpty()
							&& (status == BatchStatus.COMPLETED || status == BatchStatus.ABANDONED)) {
						throw new JobInstanceAlreadyCompleteException(
								"A job instance already exists and is complete for identifying parameters="
										+ identifyingJobParameters + ".  If you want to run this job again, "
										+ "change the parameters.");
					}

It is hard to change test cases in core package because they are almost broken and disabled.
And so it is hard to add test case.
At least, I checked that test cases in other packages are not broken.

Please let me know if there is anything I am missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: feedback-provided Issues for which the feedback requested from the reporter was provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spring batch allows job without parameters to restart even if the job already completed successfully

2 participants