Skip to content

Reinitialize runtime dependencies after full config apply #7232

@shuyangli

Description

@shuyangli

After #7185, `POST /internal/config_toml/apply` hot-swaps the in-memory `Config` and `UninitializedConfig` via `SwappableAppStateData::swap_config`, but long-lived runtime dependencies on `AppStateData` are not rebuilt:

  • `http_client` (`TensorzeroHttpClient`)
  • `clickhouse_connection_info` / `postgres_connection_info` / `valkey_connection_info`
  • `rate_limiting_manager`
  • `cache_manager`

Edits to infra sections (e.g. `[rate_limiting]`, `[gateway.cache]`, HTTP client settings) in the applied TOML will be persisted and reported as successful (new hash returned), but live requests keep using the pre-apply runtime settings until the gateway is restarted. This is a silent misconfiguration for the full-config editor flow.

To fix properly, these fields need to be wrapped in `ArcSwap` (or an equivalent hot-swappable container) so `SwappableAppStateData::swap_config` can rebuild and atomically swap them alongside the `Config`.

Context: #7185 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions