Skip to content

Prevent concurrent and reentrant tree halts from interrupting cleanup - #1296

Open
Whathelp233 wants to merge 1 commit into
BehaviorTree:masterfrom
Whathelp233:fix/1295-concurrent-tree-halt
Open

Whathelp233 wants to merge 1 commit into
BehaviorTree:masterfrom
Whathelp233:fix/1295-concurrent-tree-halt

Conversation

@Whathelp233

Copy link
Copy Markdown

Fixes #1295.

When Finally is running cleanup during a halt, a second Tree::haltTree() can reach the cleanup child through the fallback traversal. Guard the entire halt using the root node’s private state so concurrent and reentrant calls return before invoking node callbacks. The first call still completes the traversal and wakes tickWhileRunning(). The guard is released if a callback throws.

Both new regressions fail against the old library and passed 100 consecutive runs each with the fix. All 703 CTest cases passed serially, and pre-commit passed on the changed files.

OpenAI Codex assisted with the implementation and testing.

Guard the full tree halt so concurrent and reentrant calls cannot interrupt a cleanup callback. Preserve wakeup and exception handling and cover both cases with deterministic regressions.

This branch has not been deployed

No deployments
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.

Concurrent Tree::haltTree() reaches Finally's cleanup child while the first halt is still running it

1 participant