Open kkmikhaylova opened 3 years ago
Thank you for opening this issue and for providing a minimal sample. Nicely done!
Both jobs complete as expected with a STOPPED
status, but indeed the finishedJob
proceeds to the nonExecutableStep
even though the flow was interrupted in the previous step. That should not be the case. Since those flows are running in parallel, the interruption order should not matter.
Edit: Attached original sample updated to v5
Hi @fmbenhassine, I checked this issue. And I've made a fix PR https://github.com/spring-projects/spring-batch/pull/4567. PTAL 🙏
Bug description Different behavior when interrupting a job, depending on the parallel flow order. I am creating a parallel flow and trying to interrupt a job from one of them. Further behavior depends on the order of the flow inside the add() function. In one case, the job is finished immediately, in the other, all steps from another parallel flow are executed.
Flow parallelFlow = new FlowBuilder<SimpleFlow>("parallelFlow")
.split(new SimpleAsyncTaskExecutor())
.add(nonInterruptingFlow, interruptingFlow)
.build();
Environment Spring Batch: 4.3.1
Steps to reproduce
Expected behavior Same behavior after interruption.
Minimal Complete Reproducible example springbatchdemo.zip