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

reset entering of currently active state when exiting a state machine #31

Merged
merged 1 commit into from
Jan 25, 2017

Conversation

fmauch
Copy link
Contributor

@fmauch fmauch commented Jan 25, 2017

Hi there,

I had an issue with a state being in a state machine container inside a concurrent container. This concurrency got called multiple times. A simplified version is depicted below:

image

Now, when the preemption_listener stops the concurrency, the do_action-state gets preempted (which is great), and we continue with do_some_more_stuff

After some intermediate states we get back to our concurrency and then it gets exited immediately saying that do_action is preempted.

After digging for a while it turns out, that on_enter of the do_action state does not get called in the second run. The concurrency sets the _entering member inside the StateMachine container, and this exits the currently active state (which is do_action), but it doesn't reset the _entering member of do_action, so it gets skipped the next time the state is visited.

Is this behavior intentional or was it simply forgotten there? This pull request resets the _entering member for the currently active state on a state-machine exit. If this is somehow not desired, then please reject this PR, maybe with a clarification on why that is the case.

Cheers
Felix

@pschillinger
Copy link
Member

Looks like it slipped through, indeed. It is correctly set in ConcurrencyContainer and for the normal state lifecycle, but was missing for some reason for state machines.

Thanks for spotting and fixing it!

@pschillinger pschillinger merged commit 7e92733 into team-vigir:master Jan 25, 2017
fmessmer added a commit to fmessmer/flexbe_behavior_engine that referenced this pull request Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants