Skip to content

config-resolve warnings never reach the log stream on the SIGHUP reload path #1902

Closed

Description

@thiras

Found during the review of #1901.

resolve_security_into (crates/common/src/config/mod.rs) emits its operator warnings with eprintln! rather than tracing::warn!, on the documented grounds that no subscriber exists at config-resolve time. That rationale holds for resolve_config at startup. It does not hold for the function's second caller: runtime::reload::SecuritySection::resolve (crates/node/src/runtime/reload.rs:524), which runs on SIGHUP against a daemon whose subscriber has been up for hours.

Concrete case: an operator running log_format = "json" and shipping only the structured stream to their log backend sets security.max_tracked_sources = 0 and SIGHUPs. The warning —

warning: security.max_tracked_sources = 0: rate-limit bookkeeping map is unbounded; an attacker churning sources can grow it without limit

— goes to raw stderr and never reaches the pipeline. infallible_swap does emit a tracing::info! carrying the new value, but at info level and without the word "unbounded", so nothing alerts on it.

The other five annotated resolvers (resolve_dht_into, resolve_probe_into, resolve_network_into, validate_port_layout_into, warn_retired_env_vars_with) have no reload-path caller, so their reasons are accurate as written.

resolve_network_into has the same shape at startup only, and its warning is worth the same treatment: a stale DECDN_RELAY_URL collapsing a multi-entry network.relay_urls failover list to one is a silent redundancy loss that will read as an unexplained outage months later.

Suggested fix

The mechanism already half exists and is thrown away: crates/common/src/config/mod.rs:562 reads let _retired = warn_retired_env_vars(); — the function returns the names it warned about specifically so a caller can propagate them, and resolve_config discards the value.

Thread warnings out of the resolvers into an out-param the caller drains, then have commands::run re-emit them as tracing::warn! immediately after init_tracing, and have the reload path emit them directly. Nothing needs to become a hard error — 0 = unbounded is a documented escape hatch and an inherited orchestrator env var must not refuse boot. The problem is reachability, not severity.

The #[expect(clippy::print_stderr, ...)] on resolve_security_into carries a comment pointing here.

Activity

  1. added
    rust
    prio:low
    on Sep 1, 2026
  2. moved this from Backlog to Ready in deCDNon Sep 2, 2026
  3. self-assigned this
    on Sep 2, 2026
  4. moved this from Ready to In progress in deCDNon Sep 2, 2026
  5. moved this from In progress to Done in deCDNon Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

prio:lowrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions