Skip to content
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

State action is called twice in sub-submachine with fork/join #1138

Open
errd opened this issue Jan 30, 2024 · 0 comments
Open

State action is called twice in sub-submachine with fork/join #1138

errd opened this issue Jan 30, 2024 · 0 comments
Labels
status/need-triage Team needs to triage and take a first look

Comments

@errd
Copy link

errd commented Jan 30, 2024

Hi there!

Faced the issue when my state action is called twice when expected behaviour is to run once.
Here is my state machine:
Screenshot 2024-01-30 at 11 15 35

The problem is that for some reason method setCurrentState of AbstractStateMachine is called twice for state STATE_11.
Once from line 991
return setCurrentState(f, message, transition, false, stateMachine, null, fps.getForks());
and another one on line 999
return setCurrentState(toState, message, transition, true, stateMachine, null, targets);
And this leads to execution of handlers and actions twice.

I created a demo project with described behaviour:
https://github.com/errd/spring-state-machine-example
Please find in the project a test placed in StateMachineTest class.

The problem persists only when I have fork/join in the submachine, with fork/join on the first level everything works as expected.

Am I missing something from configuration point of view?
Thanks in advance!

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/need-triage Team needs to triage and take a first look
Projects
None yet
Development

No branches or pull requests

1 participant