Fix FlowBuilder.next().end() infinite loop#4475
Closed
injae-kim wants to merge 1 commit intospring-projects:mainfrom
Closed
Fix FlowBuilder.next().end() infinite loop#4475injae-kim wants to merge 1 commit intospring-projects:mainfrom
FlowBuilder.next().end() infinite loop#4475injae-kim wants to merge 1 commit intospring-projects:mainfrom
Conversation
injae-kim
commented
Oct 25, 2023
Comment on lines
-253
to
-256
| State next = createState(input); | ||
| addTransition("COMPLETED", next); | ||
| addTransition("*", failedState); | ||
| this.currentState = next; |
Contributor
Author
There was a problem hiding this comment.
if (this.currentState == null) {
doStart(input); // 1. currentState: input
}
State next = createState(input);
// 2. input -> COMPLETED -> input -> COMPLETED -> input ..
addTransition("COMPLETED", next); when currentState == null, I think we should not addTransition("COMPLETED", next); cause it makes infinite loop 🤔
injae-kim
commented
Oct 25, 2023
Comment on lines
+272
to
+275
| } else { | ||
| State state = createState(input); | ||
| tos.put(currentState.getName(), currentState); | ||
| currentState = state; |
Contributor
Author
There was a problem hiding this comment.
When currrent == null, previous doFrom logic seems createState(input) twice (inside of doStart() and L273) so I fix it~!
Contributor
Author
|
Gentle ping to @fmbenhassine , can you review this PR? I need to fix this for my service🙇 thanks for your help! |
Contributor
|
LGTM 👍 Rebased and merged as 4a67b22. Thank you for your contribution! |
Contributor
Author
|
Thanks a lot for review&merge! I'll make another contribution soon 🙇 |
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.
related issue #4432
Motivation:
FlowBuilder.next().end()never finishesaddTransition("COMPLETED", next);onnext()although there's no step registered yetModification:
FlowBuilder.next().end(), handle same asFlowBuilder.start().end()to avoid infinite loopResult:
FlowBuilder.next().end()works same asFlowBuilder.start().end()and finishes well