Skip to content

Gco/fix double exit processing #370

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

Merged

Conversation

GuiCodron
Copy link
Contributor

Problem:

  • non trivial on_exit are not triggered properly, they sometimes are trigger twice, other times trigger once and _ exit triggered once too

Solution:
Resolve the problem by matching on_exit handling inside transitions with how on_entry is handled.

Issue: #369

Reviewers:
@krzysztof-jusiak

Right now, each additional level of state machine multiply by 3
the number of times an anonymous event is processed by a sub state machine.
Add test on defer in sub state.
Fix process_defer_events return value.
Loop on process_defer_events until stability is reached.
Remove process_defer_events after process_queued_events since it was used as
stopgag when process_defer_events return value was erroneous.
Stop anonymous events from being propagated inside sub state machine.
Anonymous events are all triggered by process_event.

Without this, each additional layer multiply by 3 the number of times an
anonymous event is processed by the sub state machine.
The removed events are unexpected, those unexpected events are no
longer processed in substate machine that cannot process them due to
changes in previous commit.
@GuiCodron
Copy link
Contributor Author

GuiCodron commented Jul 29, 2020

This MR fix the bug when rebased after my other PR https://github.com/GuiCodron/sml/tree/gco/fix_recursive_processing
but it do not fix the bug on the current master branch.

non trivial events seems to be incorrectly triggered, add tests to show
that.
@GuiCodron GuiCodron force-pushed the gco/fix-double-exit-processing branch from ab6d538 to 2f1cec4 Compare July 29, 2020 19:32
exit events where sometimes called 2 times due to the fact that they
always returned false.
This was always triggering process_internal_generic_event in
include/boost/sml/back/state_machine.hpp line 190.

Change implementation to have a behavior similar to the on_entry events
but with reversed logic, bottom to top instead of top to bottom
@GuiCodron GuiCodron force-pushed the gco/fix-double-exit-processing branch from 2f1cec4 to 792cee6 Compare July 30, 2020 08:12
@kris-jusiak kris-jusiak merged commit 3737aca into boost-ext:master Jul 31, 2020
@kris-jusiak
Copy link
Collaborator

Nice @GuiCodron 👍 Thank you for tests and generation of sml.hpp 👍

@anb0s
Copy link

anb0s commented Jul 31, 2020

@GuiCodron @krzysztof-jusiak I've also faced this issue and it works as expected now, Thank You!

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.

3 participants