-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Not unique steps names in a FlowJob should raise an exception or at least log a warning #3757
Comments
Step names are used as identifiers (keys in maps in spring batch internal code) so they should be unique and the piece of code above is a non sense. |
Thank you for raising this issue. That's a valid concern. Step names must be unique within a flow definition and indeed, this is not enforced currently (as of v5.0.3). The samples in documentation were updated in dde5455 (with a warning about the importance of unique step names in flow definitions), but it is better to check this programmatically and raise and exception or log a warning when this constraint is violated. Adding name-based This will be a breaking change, so I will plan it for 5.2. |
the names of different steps in a job must be different
I created the PR to indicate work in progress but it is still in draft because 5 tests still fail |
PR #4544 is ready for review |
spring-projects#3757 Signed-off-by: Fabrice Bibonne <[email protected]>
the names of different steps in a job must be different Signed-off-by: Fabrice Bibonne <[email protected]>
the names of different steps in a job must be different Signed-off-by: Fabrice Bibonne <[email protected]>
New PR to solve the issue : #4756 |
When running a job with conditional flow, if steps in this job have the same name, the job doesn't behavior as expected (infinite loop on one step ...) because transitions in the job rely on step names. So in order to avoid such behavior, steps names in a flow job should be unique : spring batch should raise an exception or at least should log a warning.
Furthermore, in xml config, as step names are defined as ids of
<step>
, they must be unique : it is an xsd constraint.Here an example :
When running the job, spring batch loops infinitely on step3.
The text was updated successfully, but these errors were encountered: