Skip to content

Replace floating-point seconds with integer milliseconds in timing config - #388

Merged
NicolasFussberger merged 3 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/replace-float-timing-with-integer-ms
Sep 14, 2026
Merged

NicolasFussberger merged 3 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/replace-float-timing-with-integer-ms

Conversation

@shegazyy

Copy link
Copy Markdown
Contributor

…nfig

All 8 timing fields in new_lm_flatcfg.fbs are changed from double (seconds) to uint32 (milliseconds), eliminating the need for the secondsToMs() conversion helper and removing the floating-point representation from the binary format entirely.

Changes:

  • new_lm_flatcfg.fbs: 8 timing fields changed from double to uint32
  • flatbuffer_config_loader.hpp: kExpectedSchemaVersion bumped 1 → 2
  • flatbuffer_type_converters.hpp/.cpp: removed secondsToMs() and kSecondsToMilliseconds; all 7 call sites simplified to direct assignment
  • flatbuffer_type_converters_UT.cpp: removed 5 SecondsToMsTest cases; updated all FlatBuffer builder calls to pass millisecond integers
  • flatbuffer_config_loader_UT.cpp: updated all builder calls likewise
  • lifecycle_config.py (gen_config): added sec_to_ms() conversion for all 8 timing fields so the generated JSON matches the new uint32 schema
  • launch_manager.schema.json: updated schema_version enum from [1] to [2]
  • All 20 JSON config files: "schema_version": 1 → "schema_version": 2

Closes #345

@github-actions

github-actions Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

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.7.0) and connecting to it...
INFO: Invocation ID: ab979ff3-9742-4fb5-a461-302038d14e60
Computing main repo mapping: 
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 (44 packages loaded, 10 targets configured)

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

Analyzing: target //:license-check (143 packages loaded, 2865 targets configured)

Analyzing: target //:license-check (160 packages loaded, 6259 targets configured)

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

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

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

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

INFO: Analyzed target //:license-check (173 packages loaded, 11555 targets configured).
[10 / 16] Creating runfiles tree bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/score_tooling+/dash/tool/formatters/dash_format_converter.runfiles [for tool]; 0s local ... (2 actions, 1 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: 24.817s, 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>]

@github-actions

Copy link
Copy Markdown
Contributor

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

Comment thread score/launch_manager/src/daemon/src/configuration/details/new_lm_flatcfg.fbs Outdated
@NicolasFussberger

Copy link
Copy Markdown
Contributor

The build with new config feature flag bazel build //score/... --config=x86_64-linux --//config:use_new_configuration=True is currently broken (not because of your changes, but because the compiler warnings are now enforced).

Could you apply this simple fix, to get your branch build successfully with new config flag active?

score/launch_manager/src/daemon/src/main.cpp:

         auto config_result = config_loader.load(config_path);
-        if (!config_result.has_value()) {
-            LM_LOG_FATAL() << "Failed to load config from: " << config_path;
+        if (!config_result.has_value())
+        {
+            LM_LOG_FATAL() << "Failed to load config from: " << std::string_view(config_path);
             return EXIT_FAILURE;
         }
 #endif

@NicolasFussberger NicolasFussberger 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.

Thanks for your contribution! Changes look good to me.

As explained in another comments, I'd only revert the schema version increase, as the json schema is not changed here.

Please take a look at the PR checks, there are some small things to fix to make them pass.

@shegazyy
shegazyy force-pushed the fix/replace-float-timing-with-integer-ms branch from 6cb7ef1 to 662f5e5 Compare August 3, 2026 12:41
@shegazyy
shegazyy force-pushed the fix/replace-float-timing-with-integer-ms branch from 662f5e5 to ef9f1f4 Compare August 3, 2026 14:07
@shegazyy
shegazyy force-pushed the fix/replace-float-timing-with-integer-ms branch from ef9f1f4 to 31dcfb5 Compare August 16, 2026 11:58
@shegazyy
shegazyy force-pushed the fix/replace-float-timing-with-integer-ms branch from 31dcfb5 to 1b86ad5 Compare August 30, 2026 14:39
@shegazyy
shegazyy force-pushed the fix/replace-float-timing-with-integer-ms branch from 63402ea to 5fbc119 Compare September 1, 2026 14:06
@shegazyy
shegazyy force-pushed the fix/replace-float-timing-with-integer-ms branch from 5fbc119 to b0e30a6 Compare September 2, 2026 11:34
@shegazyy

shegazyy commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

hey @NicolasFussberger PR checks fixed, ready for review whenever you have the time.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-388: https://eclipse-score.github.io/lifecycle/pr-388/

@NicolasFussberger NicolasFussberger 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.

Thanks for updating the PR.
One minor point about the new polling_interval that was added recently, otherwise looks great to me

Comment thread score/launch_manager/src/daemon/src/configuration/details/lm_flatcfg.fbs Outdated
Per review feedback: FileState::polling_interval was the last timing
field still using the old double-seconds flatbuffer pattern while
every other field had already been migrated to a uint32 _ms field.

- lm_flatcfg.fbs: polling_interval:double -> polling_interval_ms:uint32 = null,
  matching every other timing field's convention.
- flatbuffer_type_converters.cpp: convertFileState() now reads
  polling_interval_ms directly via requireScalarValue(), same as every
  other _ms field. secondsToMs() is now completely unused and removed
  (it was only still called for this one field).
- lifecycle_config.py: sec_to_ms() gains the three validation checks
  that used to live only in the now-removed C++ secondsToMs()
  (negative, uint32 overflow, sub-millisecond-rounds-to-zero), so bad
  configs are rejected at generation time for every _ms field, not
  just this one. The polling_interval -> polling_interval_ms
  conversion happens where every other _ms field is already converted,
  in gen_config()'s component-building loop; the user-facing JSON
  schema is intentionally left as polling_interval (seconds), matching
  how every other field keeps its user-facing name.
- Test updates: removed the C++ SecondsToMsTest suite (function no
  longer exists) and the two negative/sub-millisecond convertFileState
  tests (that validation only happens in Python now); added the same
  five cases as sec_to_ms() unit tests in Python instead. The
  "missing polling_interval_ms" case changes from an assertion to a
  regular InvalidFormat error, consistent with every other required
  _ms field using requireScalarValue(). Regenerated
  full_config_test/expected_output/lm_config_gen.json.
@shegazyy
shegazyy force-pushed the fix/replace-float-timing-with-integer-ms branch from c85b13e to 403c4c7 Compare September 14, 2026 09:37
@shegazyy
shegazyy deployed to workflow-approval September 14, 2026 09:37 — with GitHub Actions Active
@shegazyy
shegazyy deployed to workflow-approval September 14, 2026 09:37 — with GitHub Actions Active
@shegazyy

Copy link
Copy Markdown
Contributor Author

Hello @NicolasFussberger changes are applied please let me know if any other changes are requested

@MaciejKaszynski MaciejKaszynski 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.

looks good

@NicolasFussberger

Copy link
Copy Markdown
Contributor

thanks a lot @shegazyy. Would you also do the json schema changes as a follow up so that the user actually configured ms values instead of seconds?
This was previously only postponed due to the legacy config support which in the meantime has been removed.

@NicolasFussberger
NicolasFussberger merged commit 96f9f95 into eclipse-score:main Sep 14, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in LCM - Lifecycle & Health FT Sep 14, 2026
shegazyy added a commit to Valeo-S-CORE-Organization/lifecycle that referenced this pull request Sep 15, 2026
Rename the 8 user-facing timing fields in launch_manager.schema.json
from seconds (number) to their _ms equivalents (integer), matching the
flatbuffer schema migration done in eclipse-score#388:

- reporting_cycle -> reporting_cycle_ms
- polling_interval -> polling_interval_ms
- delay_before_restart -> delay_before_restart_ms
- ready_timeout -> ready_timeout_ms
- shutdown_timeout -> shutdown_timeout_ms
- transition_timeout -> transition_timeout_ms
- evaluation_cycle -> evaluation_cycle_ms
- max_timeout -> max_timeout_ms

Remove the now-redundant sec_to_ms() conversion (and its validation)
from lifecycle_config.py, since the JSON schema's type/minimum/maximum
constraints already reject negative, non-integer and overflowing
values. Update all example configs, integration test fixtures, the
gen_lifecycle_config.py test helper, and documentation to use the new
field names and millisecond values.

This was previously postponed pending removal of legacy config
support, which has since happened in eclipse-score#388.

Closes eclipse-score#635
NicolasFussberger pushed a commit that referenced this pull request Sep 16, 2026
Rename the 8 user-facing timing fields in launch_manager.schema.json
from seconds (number) to their _ms equivalents (integer), matching the
flatbuffer schema migration done in #388:

- reporting_cycle -> reporting_cycle_ms
- polling_interval -> polling_interval_ms
- delay_before_restart -> delay_before_restart_ms
- ready_timeout -> ready_timeout_ms
- shutdown_timeout -> shutdown_timeout_ms
- transition_timeout -> transition_timeout_ms
- evaluation_cycle -> evaluation_cycle_ms
- max_timeout -> max_timeout_ms

Remove the now-redundant sec_to_ms() conversion (and its validation)
from lifecycle_config.py, since the JSON schema's type/minimum/maximum
constraints already reject negative, non-integer and overflowing
values. Update all example configs, integration test fixtures, the
gen_lifecycle_config.py test helper, and documentation to use the new
field names and millisecond values.

This was previously postponed pending removal of legacy config
support, which has since happened in #388.

Closes #635

This branch was successfully deployed

1 active deployment
workflow-approval — 403c4c7c Deployed Sep 14, 2026 by shegazyy via Build and test unit-tests-x86_64-qnx / approval #793
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[launch_manager] Replace floating point seconds with integer milliseconds for timing configuration

3 participants