hmon: parametrizable background health thread#123
Draft
arkjedrz wants to merge 1 commit intoeclipse-score:mainfrom
Draft
hmon: parametrizable background health thread#123arkjedrz wants to merge 1 commit intoeclipse-score:mainfrom
arkjedrz wants to merge 1 commit intoeclipse-score:mainfrom
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
There was a problem hiding this comment.
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
threadcrate API and storesThreadParametersin 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); |
ed690bc to
e89109e
Compare
Expose parameters to background thread.
e89109e to
a716779
Compare
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.
Expose parameters to background thread.