spring-projects / spring-projects/spring-batch

Aggregator of remote partitions is not passed all worker steps upon controller restart

Open
#5,158 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

has: minimal-example in: integration type: bug
Dominant language
Java
Stars
3k
Forks
2.5k
Avg merge
6d 53m
Merged PRs (30d)
3

Description

Bug description
In a remote partitioned job, with a controller and workers, if the controller job is stopped (for example when the pod is killed and the job is gracefully shutdown), if the remote workers steps complete, and the controller job is restarted, if the job progression is to pass the result to a aggregator, the aggregator is passed an empty list of step executions, even tho the remote steps completed successfully.

This is due to SimpleStepExecutionSplitter filtering out the executions since they were completed.

Environment
Spring boot 4.0.0, batch 6.0.0, batch-integration 6.0.0, JDK21
However this is also a issue in batch 5

Steps to reproduce

See https://github.com/brian-mcnamara/SpringBatch6/tree/shutdownAggregator for example repo

(can be run with ./gradlew run) Specifically note line 235 which expects the aggregator to be passed a list of two step executions.

Expected behavior

When the aggregator is called, it should contain the steps the worker completed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with SimpleStepExecutionSplitter and reproduce the restart scenario using the linked shutdownAggregator example repository with ./gradlew run. Inspect the flow around line 235 of BatchPartitionBugApplication.java, where the aggregator is expected to receive two completed worker step executions. Done means the restarted controller passes those completed executions to the aggregator instead of an empty list.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.