feat: reloadable refresh limits and shutdown grace - #195
Merged
Conversation
server.refresh_timeout_seconds, server.refresh_max_concurrent and server.shutdown_grace_seconds now apply on a configuration reload instead of reporting restart_required. The refresh coordinator holds a live budget (atomic) and a resizable semaphore: a grow takes effect immediately, a shrink reclaims free permits now and settles the rest at acquire time as in-flight refreshes hand theirs back. The shutdown grace is read from the current snapshot when the drain starts.
Merged
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.
What
Moves three keys off the restart-only list — they now apply on a configuration reload:
server.shutdown_grace_seconds— read at a single moment (the drain at shutdown), somainnow takes it from the currentRuntimeConfigsnapshot instead of the boot config.server.refresh_timeout_seconds— the refresh budget is anAtomicU64on the coordinator, swapped byRefreshCoordinator::resize; each refresh reads it once so the gather and its timeout message agree.server.refresh_max_concurrent— the semaphore resizes: a grow adds permits immediately (cancelling any pending shrink first); a shrink reclaims whatever is free now and records the rest as debt, settled atacquire()as in-flight refreshes hand permits back. Until it settles, concurrency is bounded by the old cap — the same overlap rule every other reload follows (in-flight work finishes under the configuration it started with). No background task involved.The values live in
RuntimeConfig(diffed for the reload report'sappliedlist);application::config::applypushes changes onto the coordinator.RestartOnlySettingsshrinks to the seven keys that genuinely need a restart.Docs
docs/config-api.mdmoves the three keys into the applied-by-reload table; the stale "refresh semaphore" example inCLAUDE.md's architecture note is updated.Tests
appliedwith an emptyrestart_required, and the running process adopts the values.