Skip to content

hmon: parametrizable background health thread#123

Draft
arkjedrz wants to merge 1 commit intoeclipse-score:mainfrom
qorix-group:arkjedrz_parametrizable-thread
Draft

hmon: parametrizable background health thread#123
arkjedrz wants to merge 1 commit intoeclipse-score:mainfrom
qorix-group:arkjedrz_parametrizable-thread

Conversation

@arkjedrz
Copy link
Contributor

Expose parameters to background thread.

@github-actions
Copy link

github-actions bot commented Mar 16, 2026

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.4.2) and connecting to it...
INFO: Invocation ID: f6a72fae-ab08-4a06-be50-bdafaf4dd96a
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'score_rust_policies', the root module requires module version score_rust_policies@0.0.3, but got score_rust_policies@0.0.5 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
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: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (37 packages loaded, 9 targets configured)

Analyzing: target //:license-check (84 packages loaded, 9 targets configured)

Analyzing: target //:license-check (89 packages loaded, 9 targets configured)

Analyzing: target //:license-check (145 packages loaded, 2642 targets configured)

Analyzing: target //:license-check (153 packages loaded, 5804 targets configured)

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

Analyzing: target //:license-check (165 packages loaded, 7901 targets configured)

Analyzing: target //:license-check (165 packages loaded, 7901 targets configured)

Analyzing: target //:license-check (166 packages loaded, 7901 targets configured)

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

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

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

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

INFO: Analyzed target //:license-check (170 packages loaded, 10039 targets configured).
[5 / 15] [Prepa] Writing repo mapping manifest for //:license.check.license_check
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
[16 / 16] no actions running
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: 29.639s, Critical Path: 2.49s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
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

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR exposes configurable parameters for the background monitoring thread, allowing callers (incl. C++ via FFI) to tune scheduling/affinity/stack size for the health monitor worker thread.

Changes:

  • Add a Rust/C++ FFI surface for constructing thread parameters and pass them into health_monitor_builder_build.
  • Thread runner now spawns the monitoring loop using a parameterizable thread crate API and stores ThreadParameters in the builder/runner.
  • Wire C++ HealthMonitorBuilder::thread_parameters(...) through to Rust, and update existing tests/build files accordingly.

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/health_monitoring_lib/rust/worker.rs Use parameterized thread spawn and store ThreadParameters in the runner.
src/health_monitoring_lib/rust/thread_ffi.rs New Rust FFI for creating/configuring thread parameters from C/C++.
src/health_monitoring_lib/rust/ffi.rs Extend health_monitor_builder_build to accept an optional thread-parameters handle.
src/health_monitoring_lib/rust/health_monitor.rs Add builder API to set thread parameters and plumb to worker creation.
src/health_monitoring_lib/rust/lib.rs Include the new thread_ffi module.
src/health_monitoring_lib/rust/*/ffi.rs Update tests to call the new health_monitor_builder_build signature.
src/health_monitoring_lib/cpp/include/score/hm/thread.h New C++ public API types for thread parameters (policy/priority/affinity/stack).
src/health_monitoring_lib/cpp/thread.cpp C++ implementation bridging to Rust thread-parameter FFI.
src/health_monitoring_lib/cpp/include/score/hm/health_monitor.h / cpp/health_monitor.cpp Add HealthMonitorBuilder::thread_parameters and pass handle into Rust build call.
src/health_monitoring_lib/cpp/tests/health_monitor_test.cpp Exercise setting thread parameters in a C++ test.
src/health_monitoring_lib/Cargo.toml / root Cargo.toml / Cargo.lock Add dependency on the thread crate and pin it.
src/health_monitoring_lib/BUILD / MODULE.bazel* Add Bazel deps/sources for the new thread API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +26 to +33
FFICode scheduler_policy_priority_min(SchedulerPolicy scheduler_policy, int32_t* priority_out);
FFICode scheduler_policy_priority_max(SchedulerPolicy scheduler_policy, int32_t* priority_out);
FFICode thread_parameters_create(FFIHandle* thread_parameters_handle_out);
FFICode thread_parameters_destroy(FFIHandle thread_parameters_handle);
FFICode thread_parameters_scheduler_parameters(FFIHandle thread_parameters_handle,
SchedulerParameters scheduler_parameters);
FFICode thread_parameters_affinity(FFIHandle thread_parameters_handle, const size_t* affinity, size_t num_affinity);
FFICode thread_parameters_stack_size(FFIHandle thread_parameters_handle, size_t stack_size);
Expose parameters to background thread.
@arkjedrz arkjedrz force-pushed the arkjedrz_parametrizable-thread branch from e89109e to a716779 Compare March 17, 2026 13:50
@arkjedrz arkjedrz requested a deployment to workflow-approval March 17, 2026 13:50 — with GitHub Actions Waiting
@arkjedrz arkjedrz requested a deployment to workflow-approval March 17, 2026 13:50 — with GitHub Actions Waiting
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