feat: dynamic user idle_timeout from patch.cfg without container restart#415
Open
rippleitinnz wants to merge 1 commit into
Open
feat: dynamic user idle_timeout from patch.cfg without container restart#415rippleitinnz wants to merge 1 commit into
rippleitinnz wants to merge 1 commit into
Conversation
When user.idle_timeout is present in patch.cfg, apply_patch_config() now updates all active user sessions via usr::update_idle_timeout() and also updates the cached metric_thresholds array for future connections. Previously user.idle_timeout was only read at startup (usr::init()) and could not be changed on a running node without a container restart. Implementation: - comm_server.hpp: added for_each_session() template to iterate live sessions (shared with feat/dynamic-mesh-idle-timeout-from-patch-cfg) - usr.cpp: added update_idle_timeout() which updates metric_thresholds[4] and calls set_threshold(IDLE_CONNECTION_TIMEOUT) on all active user sessions - conf.cpp: reads user.idle_timeout from patch.cfg in apply_patch_config(), calls usr::update_idle_timeout() when value changes Sibling PRs (part of dynamic config series): - fix/dynamic-log-level-from-patch-cfg (already raised) - feat/dynamic-mesh-idle-timeout-from-patch-cfg (already raised)
This was referenced May 20, 2026
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.
Problem
user.idle_timeoutis only read at startup inusr::init()and cached inmetric_thresholds[4]. It cannot be changed on a running node without acontainer restart, which is not possible on leased Evernode instances.
Currently
user.idle_timeoutdefaults to0(unlimited) in most deployments.However operators may wish to set a timeout to protect against stale client
connections consuming resources, or to adjust it dynamically based on workload.
Without this fix, any change to
user.idle_timeoutrequires a full containerrestart to take effect.
Fix
Three changes:
comm_server.hpp— addedfor_each_session()template method to iterateover all active sessions under mutex protection. Shared with sibling PR
feat/dynamic-mesh-idle-timeout-from-patch-cfg.usr.cpp— addedupdate_idle_timeout()which updatesmetric_thresholds[4]for future connections AND calls
set_threshold(IDLE_CONNECTION_TIMEOUT)on allexisting active user sessions via
for_each_session().conf.cpp— readsuser.idle_timeoutfrom patch.cfg inapply_patch_config(),calls
usr::update_idle_timeout()when value changes.Effect
Operators can now update
user.idle_timeoutvia patch.cfg on a running clusterwithout any container restart. Takes effect immediately on all active and future
user connections.
Sibling PRs
This is part of a series making some hpcore config fields dynamically updatable from patch.cfg:
fix/dynamic-log-level-from-patch-cfg— feat: dynamic log level update from patch.cfg without container restart #413feat/dynamic-mesh-idle-timeout-from-patch-cfg— feat: dynamic mesh idle_timeout from patch.cfg without container restart #414These three PRs should be reviewed and merged together. This PR and #414 share
the
for_each_session()template added tocomm_server.hpp.