-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix unfinished step in parallel flow #4567
base: main
Are you sure you want to change the base?
Fix unfinished step in parallel flow #4567
Conversation
f101e58
to
b8a1ba8
Compare
} | ||
} | ||
} | ||
|
||
if (!exceptions.isEmpty()) { | ||
throw exceptions.get(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As before, the first caught exception would be thrown.
jobBuilder.preventRestart().build().execute(execution); | ||
|
||
boolean isExecutedNonExecutableStep = countDownLatch.await(1, TimeUnit.SECONDS); | ||
assertEquals(BatchStatus.STOPPED, execution.getStatus()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finished with BatchStatus.STOPPED
without executing nonExecutableStep
.
This test would fail with executing nonExecutableStep
if it runs on the current main branch.
Gentle ping to @fmbenhassine. Could you review this PR? I've fixed #3939. |
Thank you for your PR!
Isn't that not desired when one of the tasks is interrupted? Meaning if one wants to interrupt a step, the idea is not to wait for other steps to finish. The change in this PR fixes the reported issue, I just want to make sure there is no side effect on the behaviour of step interruption. |
related issue #3939
Motivation
https://github.com/spring-projects/spring-batch/blob/9a2b1bbc96f338017aaa5df51214896f5a32d1e5/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java#L290C16-L290C17
Because the job already had been terminated and in STOPPED status, a step in the other flow cannot recognize it and proceeded as like there had been no interruption.
Modification
Result