mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
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