Skip to content

Cleanup alive monitor config loading - #477

Open
WilliamRoebuck wants to merge 9 commits into
eclipse-score:mainfrom
etas-contrib:feature/alive-mon-new-config
Open

Cleanup alive monitor config loading#477
WilliamRoebuck wants to merge 9 commits into
eclipse-score:mainfrom
etas-contrib:feature/alive-mon-new-config

Conversation

@WilliamRoebuck

Copy link
Copy Markdown
Contributor

This is the first step of a refactor to better integrate alive supervision and launch manager. The main change in this PR is constructing alive supervision objects component by component using the new config, instead of all components at once, stage by stage. In addition, the PR:

  • Removed unused config & constants
  • Replaced many strings with IdentifierHashes
  • Removed alive monitor config wrappers

@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

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.6.0) and connecting to it...
INFO: Invocation ID: 1995e73e-9fd5-4de0-8262-e6a06f20a274
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 (33 packages loaded, 10 targets configured)

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

Analyzing: target //:license-check (103 packages loaded, 49 targets configured)

Analyzing: target //:license-check (152 packages loaded, 3161 targets configured)

Analyzing: target //:license-check (161 packages loaded, 6925 targets configured)

Analyzing: target //:license-check (167 packages loaded, 9402 targets configured)

Analyzing: target //:license-check (172 packages loaded, 9451 targets configured)

Analyzing: target //:license-check (173 packages loaded, 9575 targets configured)

INFO: Analyzed target //:license-check (177 packages loaded, 11589 targets configured).
[11 / 16] [Prepa] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes
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: 25.854s, Critical Path: 0.34s
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>]

@WilliamRoebuck
WilliamRoebuck marked this pull request as draft August 14, 2026 15:32
@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@WilliamRoebuck
WilliamRoebuck marked this pull request as ready for review August 17, 2026 10:30
saf::ifappl::Checkpoint& checkpoint_r,
const uint16_t bufferSize)
: ISupervision(id),
k_aliveReferenceCycle(timers::TimeConversion::convertMilliSecToNanoSec(f_aliveCfg_r.reporting_cycle_ms)),

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.

Do you think we could change the underlying type to use std::chrono so that we can use duration_cast and delete our implementation of TimeConversion. Might be better to do on another issue as we could also change the configs type?

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.

Created #483

return "/lifecycle_health_" + component_name;
const std::lock_guard<std::mutex> lock(IdentifierHash::get_registry_mutex());
const auto& reg = IdentifierHash::get_registry();
const auto it = reg.find(component_name.data());

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 would probably stay away from using the registry to get actual data. I think it would work right now however this relies on something else creating the IdentifierHash before. I think right now this works because we have the ConfigAdapter that does this but in the future we won't.

Think we should also make that registry private somehow.

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 think we could just use the hash as the IPC name anyways right?

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.

Strings are added to the registry on construction so it should always work. Even if it doesn't, we fall back to the hash if the lookup fails. I could add a method get_string_from_hash() and make the registry private. What do you think?

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 don't think there is any benefit in having the name in the IPC path as it shouldn't be edited from outside our interfaces. So I'd say always use hash for the path.

{
return "/lifecycle_health_" + it->second;
}
return "/lifecycle_health_" + std::to_string(component_name.data());

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 think std::to_chars is lighter

@@ -58,7 +59,7 @@ class ISupervision

/// @brief Get the name of the configuration element for the corresponding supervision container
/// @return std::string_view View over the name of the corresponding supervision configuration container

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.

update doc string

@@ -42,7 +43,7 @@ class ISupervision
/// @brief Constructor
/// @param [in] f_supervisionConfigName_p Unique name set by configuration

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.

update docstring


#include "score/mw/launch_manager/alive_monitor/details/factory/FlatCfgFactory.hpp"
#include "score/mw/launch_manager/alive_monitor/details/ifappl/MonitorIfDaemon.hpp"
#include "score/mw/launch_manager/alive_monitor/details/supervision/Alive.hpp"

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.

need std::algo include

else
swClusterHandler.reserve(supervised_components);

// In a later refactoring step, components will register their own alive supervision and provide their identifier.

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.

Can you make an issue to track this, just so the comment doesn't get unchecked.

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.

Created #486

: osClock{f_osClock},
cycleTimer{&osClock},
swClusterHandlers{},
swClusterHandler{std::make_unique<factory::FlatCfgFactory>()},

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.

Do you think it would make sense to expose this as a param to get easier testing?

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.

This will be moved around in the next step, I'll revisit this then


bool PhmDaemon::construct(const AliveMonitorConfig& config, const SupervisionBufferConfig& f_bufferConfig_r) noexcept(
false)
bool PhmDaemon::construct(const std::vector<configuration::ComponentConfig>& config) noexcept(false)

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.

Can you make a static PhmDaemon::Create method instead.

// In a later refactoring step, components will register their own alive supervision and provide their identifier.
// For now, we iterate through them all here.

LM_LOG_DEBUG() << "Software Cluster Handler starts constructing workers";

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 don't think we use the "Software Cluster" term anymore, would be good to remove from logs.

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.

2 participants