Skip to content

Load composable nodes safely by optionally shutting down the launch process if it fails to load#516

Open
xaru8145 wants to merge 4 commits intoros2:rollingfrom
xaru8145:feature/xaru8145/load_composable_nodes_safely
Open

Load composable nodes safely by optionally shutting down the launch process if it fails to load#516
xaru8145 wants to merge 4 commits intoros2:rollingfrom
xaru8145:feature/xaru8145/load_composable_nodes_safely

Conversation

@xaru8145
Copy link

@xaru8145 xaru8145 commented Feb 12, 2026

Description

This PR introduces an optional on_failure_shutdown parameter to the LoadComposableNodes action. Currently, when a component fails to load (e.g., missing plugin, invalid parameters), the failure is logged but the launch continues. This change allows users to fail fast by raising a RuntimeError, triggering a system shutdown if a required node fails to load.

The on_failure_shutdown parameter defaults to False, strictly mimicking the previous behavior to ensure no breaking changes for existing launch files.

Changes:

  • Added on_failure_shutdown to the LoadComposableNodes constructor. The default value of False ensures exact parity with the legacy loading logic.

  • Updated _load_node to raise a RuntimeError if the service response success is False and on_failure_shutdown is enabled.

  • Raising a RuntimeError allows the LaunchService to catch the exception in its main loop, set the return code to 1, and initiate an orderly shutdown.

  • Updated specific tests and frontend tests for parsing the new parameter.

Fixes #513

Is this user-facing behavior change?

Yes. Users can now optionally specify on_failure_shutdown="true" (XML/YAML) or on_failure_shutdown=True (Python) within a LoadComposableNodes action.

  • Previous behavior: If a component failed to load into a container (e.g., due to a missing plugin or invalid parameters), the error was logged to the console, but the launch process would continue.

  • New behavior: If the flag is set to True, a load failure will now trigger an immediate RuntimeError, halting the loading of any subsequent nodes in that action and initiating a system-wide shutdown with a non-zero exit code.

Did you use Generative AI?

Yes, Gemini, for generating the tests.

Additional Information

… a RuntimeError if true and the service call to load the composable node fails

Signed-off-by: Xavier Ruiz <xavier.ruiz@ekumenlabs.com>
Signed-off-by: Xavier Ruiz <xavier.ruiz@ekumenlabs.com>
…param on_failure_shutdow

Signed-off-by: Xavier Ruiz <xavier.ruiz@ekumenlabs.com>
@xaru8145 xaru8145 force-pushed the feature/xaru8145/load_composable_nodes_safely branch from 355cf13 to a1b19bb Compare February 12, 2026 17:13
Signed-off-by: Xavier Ruiz <xavier.ruiz@ekumenlabs.com>
@kscottz
Copy link
Contributor

kscottz commented Feb 12, 2026

Sick! Thank you. You just missed the cutoff for our weekly task assignment but we'll try and get someone to review shortly.

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.

LoadComposableNodes should have an option to fail/shutdown if a node fails to load

2 participants