Skip to content

[BATCH-2675] Explicitly considering Start Time not being null for running Job Executions #659

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

Closed
wants to merge 2 commits into from

Conversation

dimitrisli
Copy link
Contributor

In an attempt to exclude erroneous Job Executions whenever considering Running Job Executions (i.e. via JobExplorer#findRunningJobExecutions()).

An example is whenever a TaskRejectedException is thrown after submitting to the taskExecutor in SimpleJobLauncher#run(), the JobExecution is left without a Start or End Time and therefore being considered as a Running Job Execution while it's not.

Also related tests are fixed.

…ning Job Executions. This is to exclude from capturing erroneous Job Executions. An example is whenever a TaskRejectedException is thrown after submitting to the taskExecutor in SimpleJobLauncher#run(), the JobExecution is left without a Start or End Time. Also related tests are fixed.
JobExecution exec = new JobExecution(jobInstance, jobParameters);
exec.setCreateTime(new Date(0));
exec.setEndTime(new Date(1L));
exec.setLastUpdated(new Date(5L));
dao.saveJobExecution(exec);

//BATCH-2675
//Abnormal JobExecution as both StartTime and EndTime are null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this! It illustrates the issue we are addressing 👍

@fmbenhassine
Copy link
Contributor

fmbenhassine commented Oct 24, 2018

Hi @dimitrisli,

Thank you for opening this PR as discussed in JIRA!
I tested your changes and they look good to me 👍
I just requested a couple of minor changes (See comments above). Please don't hesitate also to add your name and update the date to 2018 in license headers of the files you changed.

Kind regards,
Mahmoud

…ning Job Executions

Addressing code review comments
Copy link
Contributor Author

@dimitrisli dimitrisli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for the review comments. I think I've addressed them. Please take a look.

@fmbenhassine
Copy link
Contributor

Awesome! Thank you for these updates.

Rebased, squashed and merged as f8f8a02.

Thank you @dimitrisli for your contribution 👍

@dimitrisli
Copy link
Contributor Author

@benas fantastic, many thanks!

I notice now that after the merge to master there is a test failing triggered by the Bamboo Build: https://build.spring.io/browse/BATCH-GRAD-JOB1-459

I cannot reproduce locally (it always succeeds) so I'm a bit confused - let me know how can I help there.

Also if we wanted to back-port this change in 3.0.x I'm guessing we need another PR to 3.0.x this time - shall I proceed towards that direction?

@fmbenhassine
Copy link
Contributor

The build failure was not related to your changes. The build on master is successful now.

In regards to backports, I backported the fix in 4.0.x yesterday (build successful) and was about to do it for 3.0.x today. But if you want to help, you are welcome! So please go ahead and open a PR for 3.0.x, we will consider merging it when we release 3.0.10. Many thanks upfront!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants