Skip to content

Initial mw::com-based implementation of ilmcontrol interface - #478

Open
NicolasFussberger wants to merge 29 commits into
eclipse-score:mainfrom
etas-contrib:feature/new_mw_com_based_api
Open

Initial mw::com-based implementation of ilmcontrol interface#478
NicolasFussberger wants to merge 29 commits into
eclipse-score:mainfrom
etas-contrib:feature/new_mw_com_based_api

Conversation

@NicolasFussberger

@NicolasFussberger NicolasFussberger commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Initial implementation of the ilm_control interface using mw::com as the underlying communication framework.
This PR only implements the library-side.
Follow up PR will adapt the launch_manager daemon code to interact with the library via mw::com.

Closes: #480

@github-actions

github-actions Bot commented Aug 17, 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: 56b5aaaa-ae6e-4b80-bca8-ef8553316d59
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 (26 packages loaded, 10 targets configured)

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

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

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

Analyzing: target //:license-check (164 packages loaded, 6285 targets configured)

Analyzing: target //:license-check (164 packages loaded, 6285 targets configured)

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

Analyzing: target //:license-check (176 packages loaded, 11463 targets configured)

Analyzing: target //:license-check (176 packages loaded, 11463 targets configured)

INFO: Analyzed target //:license-check (177 packages loaded, 11589 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: 25.296s, Critical Path: 0.20s
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>]

@github-actions

Copy link
Copy Markdown

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

@NicolasFussberger
NicolasFussberger deployed to workflow-approval August 17, 2026 12:02 — with GitHub Actions Active
@NicolasFussberger
NicolasFussberger deployed to workflow-approval August 17, 2026 12:02 — with GitHub Actions Active
@NicolasFussberger NicolasFussberger changed the title mw::com based implementation of ilmcontrol interface Initial mw::com-based implementation of ilmcontrol interface Aug 17, 2026
@danth

danth commented Aug 19, 2026

Copy link
Copy Markdown
Member

@NicolasFussberger There are merge conflicts 😄

@NicolasFussberger

Copy link
Copy Markdown
Contributor Author

@NicolasFussberger There are merge conflicts 😄

Resolved. Though I had to downgrade again to baselibs 0.2.10, because com is not working with baselibs 0.2.11 yet.


# mw::com reads its manifest from the working-directory-relative default path
# ./etc/mw_com_config.json unless told otherwise via CLI args.
# CLI args are currently not supported with score_qnx_unit_tests, so

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

case ExecErrc::kFailedUnexpectedTerminationOnEnter:
return "Unexpected Termination during transition in Process of target Process Group State happened";
case ExecErrc::kInvalidTransition:
return "Transition invalid (e.g. report kRunning when already in Running Process State)";

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 should further clarify kInvalidTransition I think this was currently use this for what kRunTargetDoesntExist says.

class LmControlService : public Trait::Base
{
public:
using Trait::Base::Base;

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 guessing this Trait is coming from COM? Can you add a comment to explain this?

{

/// @brief Translates a RunTargetActivationSource to a human-readable string for logging.
constexpr std::string_view toStringView(const RunTargetActivationSource source) noexcept

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 this into an ostream <<operator or mw::log::LogStream <<operator instead?

case RunTargetActivationSource::kRecoveryAction:
return "RecoveryAction";
}
return "Unknown";

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 it's nice to SCORE_LANGUAGE_FUTURECPP_UNREACHABLE(); here because then you should get compiler errors if all cases are not handled.

#include "score/mw/com/types.h"
#include "score/mw/lifecycle/ilm_control.hpp"

namespace score::mw::lifecycle

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 this be in internal? I think all of the files in detail

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 be good to make some sort of component test that includes actual com implementation? I think this could be good when trying to debug interactions between us and COM.

return score::MakeUnexpected(ExecErrc::kInvalidArguments);
}

const auto start_result = Traits::StartFindService(

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.

With the interactions with COM could you not use auto as developers unfamiliar would have no idea what the type could be.

/// traits type whose Proxy is a fake, giving full control
/// for testing.
template <typename Traits = MwComProxyTraits>
class BasicLmControlImpl final : public ILmControl

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.

Clever idea to encapsulate the mwcom api with a traits type. 🤓

const auto stop_result = Traits::StopFindService(find_handle_.value());
if (!stop_result.has_value())
{
LM_LOG_ERROR() << "LmControl: StopFindService failed with error:" << stop_result.error();

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.

To my understanding this object is living in a state manager daemon, however it uses lm logging macros which are meant to be used inside lm daemon. Should be better a separate logger like LM(C)I (like Launch Manager (Control) Interface) to see already from the log statement that this code has been not executed in the daemon.

/// abstraction to expose at this level. Do not treat this interface
/// as stable until these decisions are resolved.
///
/// Establishes the mw::com connection to 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.

Is really the connection established or only initiated? What happens synchronously, what asynchronously?

/// @param[in] callback The callback to invoke, may be empty in which case the sample is dropped.
/// @param[in] sample The received activation result.
template <typename SamplePtrType>
static void forwardSample(const ActivationCallback& callback, const SamplePtrType& sample) noexcept

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.

This method is noexcept, but ActivationCallback isn't, which could lead to std::terminate.
However there is no easy way out with std::function and C++17: https://stackoverflow.com/a/31675003

}
}

if (proxy_.has_value())

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.

Does the mutex need to be acquired before accessing proxy_?

}
}

score::Result<void> activate_run_target(RunTargetName runTargetName, bool force = false) override

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.

Default value could be dropped here, as it is defined in the interface.

#include <string>
#include <string_view>

#include "score/mw/com/runtime.h"

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.

Unused include

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

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Initial implementation of mw::com-based control API (Library)

5 participants