Skip to content

Lifecycle race fix#168

Merged
wdc3iii merged 2 commits into
mainfrom
lifecycle-race-fix
Jul 6, 2026
Merged

Lifecycle race fix#168
wdc3iii merged 2 commits into
mainfrom
lifecycle-race-fix

Conversation

@wdc3iii

@wdc3iii wdc3iii commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Fixed activate/configure race condition

wdc3iii and others added 2 commits July 6, 2026 09:41
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>
@wdc3iii wdc3iii merged commit 2cfe1dc into main Jul 6, 2026
@wdc3iii wdc3iii deleted the lifecycle-race-fix branch July 12, 2026 17:05
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.

1 participant