Repository navigation
Conversation
thxwelchs
force-pushed
the
fix/job-scope-step-late-binding
branch
from
November 26, 2026 03:24
b305daa to
5c784e1
Compare
Since the duplicate step name check was added to FlowJob, it calls
getName() on every step of the flow before the flow starts. For a job
scoped step, this goes through the scoped proxy and creates the target
bean right away, before earlier steps had a chance to store the values
bound with #{jobExecutionContext[...]}. Those values are injected as
null, and since the bean is cached in the job scope, the step later runs
with them.
The check now skips scoped steps, including in nested flows, so they are
only created when the flow reaches them. Scoped steps on branches that
are not taken are not created either. Looking up steps by name is not
affected.
Resolves spring-projects#5680
Signed-off-by: Taehun Lee <thxwelchs@gmail.com>
thxwelchs
force-pushed
the
fix/job-scope-step-late-binding
branch
from
November 26, 2026 03:30
5c784e1 to
6fe79f2
Compare
Skipping scoped steps in the duplicate step name check also stopped reporting duplicates involving them. A scoped step is now checked when the flow reaches it, against the step names seen so far, so the check never creates a scoped step itself. An exception thrown by the check is logged at debug level and does not fail the job. Related to spring-projects#5680 Co-authored-by: Yanming Zhou <zhouyanming@gmail.com> Signed-off-by: Taehun Lee <thxwelchs@gmail.com>
Author
Contributor
|
After reviewing changes in |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #5680
Background
Since 6.0.6,
FlowJob#doExecutechecks for duplicate step names before the flow starts (#3757). The check callsgetName()on every step of the flow.Problem
@JobScopestep,getName()goes through the scoped proxy and creates the target bean when the job starts.#{jobExecutionContext[...]}are resolved before earlier steps had a chance to store them, so they are injected asnulland the step later runs with that value. The same job works with 6.0.5.Fix
As agreed in #5680:
Tests cover late binding of
jobExecutionContext, a scoped step on a branch that is not taken, duplicates between scoped steps and between a scoped and a non-scoped step, and a failing check.