Skip to main content

Module config_reload

Module config_reload 

Source
Expand description

Hot configuration reload.

Re-reads rws.config.toml without restarting the server. Non-binding settings — those that would require a new TCP socket (IP, port, thread count) or a new TLS acceptor (cert/key paths) — are logged as ignored. All other settings take effect on the next incoming request.

§Triggering a reload

  • Unix signal: send SIGHUP to the server process.
    kill -HUP $(pidof rws)
  • HTTP endpoint: POST /admin/config/reload (no body required).

§What is hot-reloadable

SettingEnv var
CORS — all fieldsRWS_CONFIG_CORS_*
Rate-limit thresholdsRWS_CONFIG_RATE_LIMIT_MAX_REQUESTS, RWS_CONFIG_RATE_LIMIT_WINDOW_SECS
Log formatRWS_CONFIG_LOG_FORMAT
Request allocation sizeRWS_CONFIG_REQUEST_ALLOCATION_SIZE_IN_BYTES

§What is NOT hot-reloadable (requires restart)

SettingWhy
IP / PortBound socket cannot be moved
Thread countThread pool is fixed at startup
TLS cert / keyTLS acceptor is built once at startup

Structs§

ConfigSnapshot
Snapshot of all hot-reloadable configuration values at a point in time.

Statics§

RELOAD_REQUESTED
Global flag set by the SIGHUP signal handler.

Functions§

current
Returns a clone of the current hot-reloadable configuration snapshot.
install_sighup_handler
Install a SIGHUP signal handler that sets RELOAD_REQUESTED.
reload
Re-read rws.config.toml and apply all hot-reloadable changes in-place.