Lifecycle race fix#168
Merged
Merged
Conversation
With auto_start, the global_state node configures and activates within milliseconds of launch -- typically before slow-starting component processes (python nodes with heavy imports) have created their change_state services. launch delivers each emitted ChangeState event on its own service-waiting thread with no per-node ordering, so a component's activate (keyed off global_state reaching `active`) could be delivered before its still-pending configure. rclpy lifecycle nodes then die on the invalid transition: __on_change_state calls trigger_transition_by_id unguarded, the RCLError propagates out of executor.spin(), and the process exits. Symptom: intermittent "[rcl_lifecycle] No transition matching 3 found for current state unconfigured" followed by the node dying at startup. Fix: when auto-starting, key each component's initial activation off ITS OWN configuring->inactive transition (handle_once), making the configure->activate order structural. Manual obk-deactivate -> obk-activate cycles still propagate from the global state node via a new handler that skips only the first (auto-start) global activation; by any later one the components are alive and configured, so the race cannot recur. Launches without auto_start keep the previous global-keyed activation unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed activate/configure race condition