Skip to content

Step execution no longer persisted after partitioner creates the context #5138

@brian-mcnamara

Description

@brian-mcnamara

Bug description
With this change, a steps context is no longer persisted inside SimpleStepExecutionSplitter.java, causing the execution context created by a partitioner to be lost, preventing a remote worker from loading the created context. Specifically the call to jobRepository.addAll prior to batch 6 ensured the context was persisted

Specifically, after the contexts are created, MessageChannelPartitionHandler.doHandle is responsible to create and send the message, when the remote worker receives the message, it loads the steps through the job repository.

Environment
Spring boot 4.0.0, batch 6.0.0, batch-integration 6.0.0, JDK21

Steps to reproduce

See https://github.com/brian-mcnamara/SpringBatch6/blob/main/src/main/java/com/example/batchpartitionbug/BatchPartitionBugApplication.java

(can be run with ./gradlew run) Specifically note line 91 which should get the context from the partitioner on line 197

This bug is seen with a partitioned step using message channels for delivery and a persistence layer for the jobRepository.

Expected behavior

The partitioner should initialize the step contexts on the controller and update the step in the repository. This enabling the worker to load the step from the repository and use the context created earlier

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions