When mesh.idle_timeout is present in patch.cfg, apply_patch_config() now
updates all active peer sessions via a new p2p::update_idle_timeout() function
and also updates the cached metric_thresholds array for future connections.
Previously mesh.idle_timeout was only read at startup (p2p::init()) and could
not be changed on a running node without a container restart. This is critical
for operators who need to increase roundtime beyond mesh.idle_timeout * 4 —
without this fix, increasing roundtime past 480000ms (at default idle_timeout
of 120000ms) causes peer disconnections and permanent consensus failure.
Implementation:
- comm_server.hpp: added for_each_session() template to iterate live sessions
- p2p.cpp: added update_idle_timeout() which updates metric_thresholds[4] and
calls set_threshold(IDLE_CONNECTION_TIMEOUT) on all active sessions
- conf.cpp: reads mesh.idle_timeout from patch.cfg in apply_patch_config(),
calls p2p::update_idle_timeout() when value changes
Sibling PRs (part of dynamic config series):
- fix/dynamic-log-level-from-patch-cfg (already raised)
- feat/dynamic-user-idle-timeout-from-patch-cfg (to be raised)
Fixes: mesh connections dropping during long roundtimes
When log.log_level is present in patch.cfg, apply_patch_config() now
updates the live plog logger severity via plog::get()->setMaxSeverity()
in addition to persisting the change to hp.cfg and the runtime cfg struct.
Previously log level was only read at startup (hplog::init()) and could
not be changed on a running node without a container restart. This meant
operators had no way to change log verbosity on external Evernode hosts
where they don't control the container lifecycle.
The fix uses plog's built-in setMaxSeverity() API which is thread-safe
and takes effect immediately on the next log statement.