Skip to content

fix(role): treat an unreadable pressure file as no pressure and say the pressure is unknown - #205

Merged
Mearman merged 2 commits into
mainfrom
fix/probe-no-psi
Nov 3, 2026
Merged

Mearman merged 2 commits into
mainfrom
fix/probe-no-psi

Conversation

@Mearman

@Mearman Mearman commented Nov 3, 2026

Copy link
Copy Markdown
Member

A kernel without pressure stall information either has no /proc/pressure (built or booted without it, on kernels that create the files only when PSI is on) or, on older kernels, keeps /proc/pressure/memory and fails every read with EOPNOTSUPP (psi_proc_init creates the files unconditionally in v5.4 and only if (psi_enable) from v5.15, while psi_show returns -EOPNOTSUPP when PSI is disabled: v5.4, v5.15). The probe already handled the first; on the second it only checked that the file was readable by its mode, so check memory exited on the failed read and every sample logged the error. A failed read is now the same as no file.

The controller already counted a host with no pressure readings as not over the regrade limit, since that limit needs pressure and a low MemAvailable together, but its status gave no sign that pressure had not been judged. A host none of whose window has a pressure reading now lists memory pressure in unknown_signals, the log adds memory pressure unknown to its verdict, and figures.psi_avg300_max gives the window's worst pressure (null then). The verdict is unchanged: MemAvailable is still held to etcd's storage quota, and the missing reading withholds nothing.

Tests: the probe's sample and check memory against /proc/self/mem, which stands in for a pressure file that exists, is readable by its mode and fails a read (both fail on the previous probe, run on a Linux host), and the controller's status and log for a host with and without pressure readings, including one still failed by MemAvailable under the quota (that test fails with unknown_signals broken).

Refs #184

@Mearman
Mearman force-pushed the fix/probe-no-psi branch 2 times, most recently from 968cff2 to ac37a71 Compare November 3, 2026 19:14
…efuses to read

An older kernel built or booted without pressure stall information keeps
/proc/pressure/memory and fails every read of it with EOPNOTSUPP; newer ones
have no /proc/pressure at all. The probe only checked that the file was
readable by its mode, so on such a kernel `check memory` exited on the failed
read and every sample logged the read error. A read that fails now gives the
sample no pressure reading, as a missing file does.
A host none of whose samples has a pressure reading cannot be over the
regrade limit, which needs pressure and a low MemAvailable together, so it was
judged by MemAvailable against etcd's quota alone without the status saying so.
Its status now lists `memory pressure` in unknown_signals, the log adds
"memory pressure unknown" to its verdict, and figures carry the window's worst
pressure as psi_avg300_max. The verdict itself is unchanged: the missing
reading withholds nothing.
@Mearman
Mearman marked this pull request as ready for review November 3, 2026 20:15
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-11-03T20:16:00.498866Z
We couldn’t complete this review. Comment @codex security review to try again.
85930cf Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@Mearman
Mearman merged commit 3188c8d into main Nov 3, 2026
28 checks passed
@Mearman
Mearman deleted the fix/probe-no-psi branch November 3, 2026 20:16
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.31.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant