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
Open
Conversation
… 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>
355cf13 to
a1b19bb
Compare
Signed-off-by: Xavier Ruiz <xavier.ruiz@ekumenlabs.com>
Contributor
|
Sick! Thank you. You just missed the cutoff for our weekly task assignment but we'll try and get someone to review shortly. |
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.
Description
This PR introduces an optional
on_failure_shutdownparameter to theLoadComposableNodesaction. 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 aRuntimeError, triggering a system shutdown if a required node fails to load.The
on_failure_shutdownparameter defaults to False, strictly mimicking the previous behavior to ensure no breaking changes for existing launch files.Changes:
Added
on_failure_shutdownto theLoadComposableNodesconstructor. The default value of False ensures exact parity with the legacy loading logic.Updated
_load_nodeto raise aRuntimeErrorif the service response success is False andon_failure_shutdownis enabled.Raising a
RuntimeErrorallows 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) oron_failure_shutdown=True(Python) within aLoadComposableNodesaction.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