-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect retrieval of job parameters in SimpleJobExplorer#getJobExecutions #4246
Comments
Thank you for opening this issue. We do not exclude that this could be a bug in Spring Batch. However, we would like to validate that with a minimal complete verifiable example. Could you please take some time to create a minimal example that reproduces the problem? To help you in reporting your issue, we have prepared a project template that you can use as a starting point. Please check the Issue Reporting Guidelines for more details about this. Thank you for your collaboration. |
Hi, Feel free to reach out to me, if you need more information! |
Hi @fmbenhassine, I think I've found the cause. Is it okay if I try to contribute? |
@CNJingo Sure! Thank you for your offer to help. Any issue without an already open PR or tagged with FYI, we are planning to include this in v5.0.2 coming out on May 17th. Let me know if you need help on the fix. |
@fmbenhassine Thank you so much for explaining the guidelines so well. In fact, I've already created a PR. I would really appreciate it if you could review the PR. |
Add integration test Related to #4246
Before this commit, SimpleJobExplorer#getJobExecutions returned job executions with wrong job parameters, ie a job execution could have the parameter of another execution. This commit fixes the implementation so that each returned job execution has its own parameters. Resolves #4246
Add integration test Related to #4246
Bug description
The following method
List<JobExecution> getJobExecutions(JobInstance jobInstance)
in theSimpleJobExplorer
class returns the wrong job parameters when a job instance is started multiple times with different job parameters (identifying job parameters are the same but the non-identifying parameters were changed)Environment
Versions:
Steps to reproduce
List<JobExecution> getJobExecutions(JobInstance jobInstance)
Expected behavior
Either document this behavior or change the implementation to fetch the job parameters of each job execution.
Implementation hint
I think this behavior is because the
JdbcJobExecutionDao
only fetches the job parameters once for a job instance and then reuses them for each job execution.JdbcJobExecutionDao
A fixed version would fetch the job parameters for each execution because each job execution has its own job parameters, see
batch_job_execution_params
table.This would impact the performance of the method, because more data would need to be fetched.
The text was updated successfully, but these errors were encountered: