Skip to content

Add test for comp_req__launch_man__fast_shutdown_support - #573

Open
TimoSteuerwaldETAS wants to merge 5 commits into
eclipse-score:mainfrom
etas-contrib:feature/lm_sigkill_children_survive
Open

Add test for comp_req__launch_man__fast_shutdown_support#573
TimoSteuerwaldETAS wants to merge 5 commits into
eclipse-score:mainfrom
etas-contrib:feature/lm_sigkill_children_survive

Conversation

@TimoSteuerwaldETAS

Copy link
Copy Markdown
Contributor

This test verifies the following requirement:

.. comp_req:: Fast shutdown
    :id: comp_req__launch_man__fast_shutdown_support
    :reqtype: Functional
    :security: NO
    :safety: ASIL_B
    :derived_from: feat_req__lifecycle__terminationn_dependency[version==1]
    :status: valid
    :version: 1
    :satisfied_by: comp__lifecycle_launch_manager

    The :term:`Launch Manager` shall support fast shutdown by terminating itself
    without considering the started :term:`Processes <Process>`.

Part of #317 .

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.7.0) and connecting to it...
INFO: Invocation ID: 4259a43e-6a47-4829-be44-07b3ce796ec4
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (45 packages loaded, 10 targets configured)

Analyzing: target //:license-check (88 packages loaded, 10 targets configured)

Analyzing: target //:license-check (148 packages loaded, 3143 targets configured)

Analyzing: target //:license-check (157 packages loaded, 8008 targets configured)

Analyzing: target //:license-check (163 packages loaded, 9367 targets configured)

Analyzing: target //:license-check (168 packages loaded, 9417 targets configured)

Analyzing: target //:license-check (169 packages loaded, 9541 targets configured)

INFO: Analyzed target //:license-check (173 packages loaded, 11555 targets configured).
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 23.008s, Critical Path: 0.25s
INFO: 16 processes: 4 disk cache hit, 12 internal.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

assert proc.is_running(), "Launch manager exited before it could be killed"
code, out = target.execute(f"kill -9 {proc.pid()}")
assert code == 0, f"Failed to SIGKILL launch manager (pid {proc.pid()}): {out!r}"
proc.wait(timeout_s=3.0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really the intended implementation of "fast shutdown" by killing the launch manager?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least this is how I have understood it. This is what I have noted:

Some kind of brute force shutdown. (May be) related to qnx feature which is watching the running processes, if launch manager is gone, system gets restarted anyways. This is most probably faster then stop triggering the watchdog and waiting for the timeout which initiates the system restart.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #564 we removed this actually.
But I also think if you're going to add this to the new method, I think instead we should have a parameter called expected_return_code: int = 0 instead so that it is more generic.


# The child processes must survive the death of their parent.
assert _pid_alive(target, daemon_pid), (
f"Control daemon (pid {daemon_pid}) died with the launch manager"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we test that they survive? Not sure it's relevant for the requirement.

"""
Objective: Verifies that processes started by the Launch Manager keep running
when the Launch Manager itself is killed with SIGKILL, i.e. without any chance
to tear its children down.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the fast shutdown should be a sigkill, in that case I'm not sure if there is anything to test really as the LCM doesn't really have anything to say about getting killed.
In that case I also don't know if we should even have a requirement for this, as there is no code we write that changes the behavior.
But if this improves the component req coverage then I guess we might as well test it?

I think we need to clarify why the req is required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point, we can do so again today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants