Files
Raúl Marín 62b7c89e51 Address PR review on MemoryThreadStacks*: tidy fix, opt-in warning, test skip
Three follow-ups to the prctl(PR_SET_VMA_ANON_NAME) rewrite:

1. arm_tidy `bugprone-suspicious-stringview-data-usage` on the
   `prctl(..., THREAD_STACK_VMA_NAME.data())` call. The literal is
   NUL-terminated but tidy can't see that through `std::string_view`.
   Switch the constant to `inline constexpr const char *` and pass it
   directly to `prctl`.

2. `setThreadName` no longer logs the "kernel too old" warning. It
   only records the unsupported state silently via the atomic flag.
   On a default server (heavy metrics disabled) the user did not opt
   into the metric, so a startup-time log warning would be noise.
   `ServerAsynchronousMetrics::updateThreadStackStats` already runs only
   when heavy metrics are enabled; emit the one-shot `LOG_WARNING` and
   `system.warnings` row from there.

3. Integration test now `pytest.skip`s when the metric is unavailable
   (older kernel without PR_SET_VMA_ANON_NAME, or restricted container
   that cannot open /proc/self/smaps) by checking `system.warnings`
   first. Keeps invariant assertions for kernels where the metric is
   actually supported.

See https://github.com/ClickHouse/ClickHouse/pull/106230#discussion_r3405282017
and https://github.com/ClickHouse/ClickHouse/pull/106230#discussion_r3405282020
2026-06-15 12:26:09 +00:00
..