Skip to content

Using ReactiveSequence/ReactiveFallback with multiple async children can cause race conditions #1031

@pleemann

Description

@pleemann

Describe the bug

BehaviorTree.CPP allows to implement backchaining patterns (as described e.g. in #755 ), but there is a challenge with the current implementation: As described in #83 (comment), which also provides a good minimal example, a previously RUNNING child is halted only after another child is started (its onStart is executed). So for a short amount of time, there are two children in RUNNING state.

In a scenario, where the async children start ROS actions in the onStart function, and cancel the actions in the onHalted, this can lead to race conditions in the system, as multiple actions are running simultaneously.

There was a PR to address this problem, #93, but sadly, it was never merged. Is there a better solution to address this problem? If the solution proposed in that PR is still the way to go, I can also spend some time to update it to the most recent version of the library (as the PR is quite old).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions