Skip to content

Express configured durations in seconds, not polls - #151

Open
tmakatos wants to merge 1 commit into
per-vm-log-layerfrom
config-durations
Open

tmakatos wants to merge 1 commit into
per-vm-log-layerfrom
config-durations

Conversation

@tmakatos

Copy link
Copy Markdown
Collaborator

Durations are now integer seconds in settings ending in _secs:

scale_poll_secs, cooldown_secs (now integers, were floats)
scale_down_sustain_polls -> scale_down_sustain_secs
scale_validation_sample_polls -> scale_validation_delay_secs
scale_validation_sample_polls_per_thread -> scale_validation_delay_per_thread_secs
post_revert_up_grace_polls -> post_revert_up_grace_secs
post_revert_up_recovery_polls -> post_revert_up_recovery_secs
post_revert_up_backoff_max_polls -> post_revert_up_backoff_max_secs
scale_down_backoff_max_polls -> scale_down_backoff_max_secs

Every duration must be a multiple of scale_poll_secs. The engine
receives the poll period when it is built and converts its durations to
polls once, so engine logic is unchanged. The daemon refuses to start if
any duration, controller or engine, is not a multiple, listing all of
them with the nearest valid values.

The round_up_durations config option and --round-up-durations flag
(both off by default) instead round such durations up with a warning,
so that a new poll period can be tried without rewriting the config.
The daemon now logs the effective controller, engine, and backend
configuration at startup, which shows rounded values.

The daemon also prints errors with Display rather than Debug.

AI-generated: everything.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@tmakatos
tmakatos added this pull request to stack #149 October 23, 2026 07:12
@tmakatos
tmakatos marked this pull request as draft October 23, 2026 07:13
@tmakatos
tmakatos force-pushed the config-durations branch 2 times, most recently from 180df31 to 599df58 Compare October 23, 2026 22:09
@tmakatos
tmakatos marked this pull request as ready for review October 23, 2026 22:24

@lforchini lforchini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you mention in the commit message why we're doing this change? Currently it just says how to cope with the restrictions it adds.

Still working on full review.

Comment thread README.md
Comment thread src/config.rs
@tmakatos
tmakatos force-pushed the config-durations branch 5 times, most recently from 87ff267 to e71d759 Compare October 26, 2026 16:44
@tmakatos

Copy link
Copy Markdown
Collaborator Author

Can you mention in the commit message why we're doing this change? Currently it just says how to cope with the restrictions it adds.

Still working on full review.

Updated the commit message.

Expressing parameters in poll cycles makes it trivial for the
implementation but harder for the operator to understand since they
have to multiply the parameters by the poll cycle duration to get to the
actual value. Express everything in seconds instead, even if that
complicates the implementation.

Durations are now integer seconds in settings ending in _secs:

  scale_poll_secs, cooldown_secs              (now integers, were floats)
  scale_down_sustain_polls                 -> scale_down_sustain_secs
  scale_validation_sample_polls            -> scale_validation_delay_secs
  scale_validation_sample_polls_per_thread -> scale_validation_delay_per_thread_secs
  post_revert_up_grace_polls               -> post_revert_up_grace_secs
  post_revert_up_recovery_polls            -> post_revert_up_recovery_secs
  post_revert_up_backoff_max_polls         -> post_revert_up_backoff_max_secs
  scale_down_backoff_max_polls             -> scale_down_backoff_max_secs

Every duration must be a multiple of scale_poll_secs. The engine
receives the poll period when it is built and converts its durations to
polls once, so engine logic is unchanged. The daemon refuses to start if
any duration, controller or engine, is not a multiple, listing all of
them with the nearest valid values.

The round_up_durations config option and --round-up-durations flag
(both off by default) instead round such durations up with a warning,
so that a new poll period can be tried without rewriting the config.
The daemon now logs the effective controller, engine, and backend
configuration at startup, which shows rounded values.

The daemon also prints errors with Display rather than Debug.

AI-generated: everything, manual fixup of the commit message
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
@tmakatos
tmakatos removed this pull request from stack #149 October 26, 2026 18:18
@tmakatos
tmakatos added this pull request to stack #167 October 26, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants