Skip to content

hmon: Define configuration schema - #340

Open
eduard-moskalchuk wants to merge 1 commit into
eclipse-score:mainfrom
eduard-moskalchuk:edmo_health_monitor_config
Open

hmon: Define configuration schema#340
eduard-moskalchuk wants to merge 1 commit into
eclipse-score:mainfrom
eduard-moskalchuk:edmo_health_monitor_config

Conversation

@eduard-moskalchuk

@eduard-moskalchuk eduard-moskalchuk commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Example JSON configuration:

{
  "schema_version": 1,
  "supervisor_api_cycle_ms": 100,
  "internal_processing_cycle_ms": 50,
  "thread_parameters": {
    "policy": "POSIX_FIFO",
    "priority": 20,
    "affinity": [0, 1],
    "stack_size": 262144
  },
  "deadline_monitors": [
    {
      "monitor_tag": "control_loop_deadlines",
      "deadlines": [
        {
          "deadline_tag": "read_inputs",
          "range": {
            "min_ms": 1,
            "max_ms": 5
          }
        },
        {
          "deadline_tag": "publish_outputs",
          "range": {
            "min_ms": 2,
            "max_ms": 10
          }
        }
      ]
    }
  ],
  "heartbeat_monitors": [
    {
      "monitor_tag": "planner_heartbeat",
      "range": {
        "min_ms": 90,
        "max_ms": 110
      }
    }
  ],
  "logic_monitors": [
    {
      "monitor_tag": "operation_mode_flow",
      "initial_state": "initializing",
      "states": [
        {
          "state": "initializing",
          "allowed_transitions": ["running", "fault"]
        },
        {
          "state": "running",
          "allowed_transitions": ["degraded", "fault"]
        },
        {
          "state": "degraded",
          "allowed_transitions": ["running", "fault"]
        },
        {
          "state": "fault",
          "allowed_transitions": []
        }
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 21, 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: d3b25990-427f-44c3-887e-6f7a077387c3
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: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

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

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

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

Analyzing: target //:license-check (151 packages loaded, 4089 targets configured)

Analyzing: target //:license-check (156 packages loaded, 5498 targets configured)

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

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

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

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

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

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

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[5 / 14] [Prepa] Writing repo mapping manifest for @@score_tooling+//dash/tool/formatters:dash_format_converter [for tool]
[15 / 16] [Prepa] Building license.check.license_check.jar ()
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: 24.109s, Critical Path: 2.09s
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>]

@eduard-moskalchuk
eduard-moskalchuk marked this pull request as draft July 21, 2026 15:09
@github-actions

Copy link
Copy Markdown

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

Comment thread score/health_monitor/src/cpp/health_monitor_loader.h Outdated
Comment thread score/health_monitor/configuration/health_monitor_config.fbs Outdated
Comment thread score/health_monitor/configuration/health_monitor_config.fbs
@eduard-moskalchuk
eduard-moskalchuk force-pushed the edmo_health_monitor_config branch from 8c18416 to 7863fe8 Compare July 22, 2026 15:07
@eduard-moskalchuk
eduard-moskalchuk force-pushed the edmo_health_monitor_config branch from 7863fe8 to 032724b Compare July 23, 2026 06:56
@eduard-moskalchuk eduard-moskalchuk changed the title hmon: Define configuration schema and Loader C++ API hmon: Define configuration schema Jul 23, 2026
Comment thread score/health_monitor/configuration/health_monitor_config.fbs Outdated
version_minor: uint32 = 0 (id:1);
supervisor_api_cycle_ms: uint32 (id:2);
internal_processing_cycle_ms: uint32 (id:3);
thread_parameters: ThreadParameters (id:4);

@NicolasFussberger NicolasFussberger Jul 23, 2026

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.

Not related to these changed, but I would be curious @eduard-moskalchuk if this thread configuration is working in your context.
I would assume in production environment application process will not have the privileges to changes the affinity or scheduling policy / priority for any of its threads.

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.

Probably not. In QNX some secpol abilities would be required for that, and most applications don't have them.

Comment thread score/health_monitor/configuration/health_monitor_config.fbs Outdated

@SimonKozik SimonKozik left a comment

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.

It is difficult for me to comment on the LogicMonitor, StateNode, HeartbeatMonitor, DeadlineMonitor and DeadlineEntry definitions without seeing an example configuration.

I would appreciate if we could have an example configuration (for all possible configuration parameters), so we could better asses the schema.

Comment thread score/health_monitor/configuration/health_monitor_config.schema.json Outdated
Comment thread score/health_monitor/configuration/health_monitor_config.schema.json Outdated
Comment on lines +15 to +19
"supervisor_api_cycle_ms": {
"type": "integer",
"minimum": 1,
"description": "Cycle duration in ms for supervisor API notifications"
},

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.

LM is using seconds as the measurement unit of time (e.g., '0.5' for 500 milliseconds). I would be tempted to suggest that we should use the same approach for health monitoring.

This way integrator will be not restricted with precision they would like to use. Encoding precision in parameter name will force configuration change, when we would allow different precision.

Additionally it may be useful to define time as a reusable type. This type can be then used by supervisor_api_cycle, internal_processing_cycle and TimeRange

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.

If we use floating point numbers, we may have to prove that we do it in a safe way. An activity that can be avoided. Please see the issue #345

Comment thread score/health_monitor/configuration/health_monitor_config.schema.json Outdated
Comment thread score/health_monitor/configuration/health_monitor_config.schema.json Outdated
@eduard-moskalchuk

Copy link
Copy Markdown
Contributor Author

It is difficult for me to comment on the LogicMonitor, StateNode, HeartbeatMonitor, DeadlineMonitor and DeadlineEntry definitions without seeing an example configuration.

I would appreciate if we could have an example configuration (for all possible configuration parameters), so we could better asses the schema.

@SimonKozik I added an example to the PR description. Would it make sense to push it as a file as well?

@SimonKozik

Copy link
Copy Markdown
Contributor

It is difficult for me to comment on the LogicMonitor, StateNode, HeartbeatMonitor, DeadlineMonitor and DeadlineEntry definitions without seeing an example configuration.
I would appreciate if we could have an example configuration (for all possible configuration parameters), so we could better asses the schema.

@SimonKozik I added an example to the PR description. Would it make sense to push it as a file as well?

@eduard-moskalchuk Thanks for the example. I would definitely recommend to store it alongside schema (this is what LM also does).

Does it make sense to get rid of the tags? For me it is just extra typing for the user, without added value to the information that is stored. An example could looks like this:

{
  "deadline_monitors": {
    "control_loop_deadlines": {
      "read_inputs": {
        "min_ms": 1,
        "max_ms": 5
      },
      "publish_outputs": {
        "min_ms": 2,
        "max_ms": 10
      }
    },
    "communication_deadlines": {
      "receive": {
        "min_ms": 1,
        "max_ms": 3
      },
      "transmit": {
        "min_ms": 2,
        "max_ms": 8
      }
    }
  }
}

}
},
"additionalProperties": false,
"definitions": {

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.

Suggested change
"definitions": {
"$defs": {

In 2020-12 schema, the recommended location for reusable schema fragments is $defs


/// Scheduler policy for the monitoring thread.
enum SchedulerPolicy : byte {
Other = 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.

Does this need to be adapted as well to the new names POSIX_OTHER?
I assume you want to directly compile the json to flatbuffer without any conversion script

},
"description": "CPU core IDs the thread can run on"
},
"stack_size": {

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 put the unit into the name, as we did with the timing values (_ms)?
e.g. stack_size_bytes?

table HealthMonitorConfig {
schema_version: uint32 = null;
supervisor_api_cycle_ms: uint32;
internal_processing_cycle_ms: uint32;

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.

Are supervisor_api_cycle_ms and internal_processing_cycle_ms optional values?
Currently, flatbuffer will return 0 here if not configured.
This might be OK since 0 will be invalid.
Though using = null may be more explicit if its really optional


/// Root configuration for a HealthMonitor instance.
table HealthMonitorConfig {
schema_version: uint32 = null;

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 the schema version really optional?

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.

4 participants