Replace floating-point seconds with integer milliseconds in timing config - #388
Conversation
…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 eclipse-score#345 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 |
| // Duration in seconds of the time interval used to verify alive notifications. | ||
| reporting_cycle:double = null; // required | ||
| // Duration in milliseconds of the time interval used to verify alive notifications. | ||
| reporting_cycle:uint32 = null; // required |
There was a problem hiding this comment.
could we change the names here also with _ms suffix? Then it also be obvious in the generated code that this is in ms
| "description": "Specifies the schema version number that the Launch Manager uses to determine how to parse and validate this configuration file.", | ||
| "enum": [ | ||
| 1 | ||
| 2 |
There was a problem hiding this comment.
We have the difficulty a bit that we are currently in transition.
The new_lm_flatcfg.fbs is the new flatbuffer schema that shall replace the legacy flatbuffer configs.
Though this is currently still only under a feature flag active. The regular build is still using the legacy configs.
My proposal for this PR would be:
- We keep the adaptation for the new config path
- We do not adapt the old config anymore as this is removed soon
- We leave the user-facing json schema unchanged for now, and adapt this once the feature flag is gone and the new config is in use. Then we'll change the user-facing json config from seconds to ms as well.
- This means the translation btw. seconds->ms is done in the lifecycle_config.py for now, as the user-facing json is still configured with seconds (unchanged) and the new flatbuffer schema expects milliseconds (changed).
I think this matches what you already did, only the user-facing json schema change would need to be reverted. As the user-facing json schema is anyway not changed here, I think we don't need to increase the schema version.
What do you think?
|
The build with new config feature flag 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: |
NicolasFussberger
left a comment
There was a problem hiding this comment.
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.
…nfig
All 8 timing fields in
new_lm_flatcfg.fbsare changed fromdouble(seconds) touint32(milliseconds), eliminating the need for thesecondsToMs()conversion helper and removing the floating-point representation from the binary format entirely.Changes:
new_lm_flatcfg.fbs: 8 timing fields changed fromdoubletouint32flatbuffer_config_loader.hpp:kExpectedSchemaVersionbumped 1 → 2flatbuffer_type_converters.hpp/.cpp: removedsecondsToMs()andkSecondsToMilliseconds; all 7 call sites simplified to direct assignmentflatbuffer_type_converters_UT.cpp: removed 5SecondsToMsTestcases; updated all FlatBuffer builder calls to pass millisecond integersflatbuffer_config_loader_UT.cpp: updated all builder calls likewiselifecycle_config.py(gen_config): addedsec_to_ms()conversion for all 8 timing fields so the generated JSON matches the new uint32 schemalaunch_manager.schema.json: updatedschema_versionenum from[1]to[2]"schema_version": 1→"schema_version": 2Closes #345