Skip to content

Allow skipping oom_score_adj write via ACTIONS_RUNNER_DISABLE_OOM_SCORE_ADJ env var#4478

Open
biagiopietro wants to merge 2 commits into
actions:mainfrom
biagiopietro:feat/disable-oom-score-adj-env-var
Open

Allow skipping oom_score_adj write via ACTIONS_RUNNER_DISABLE_OOM_SCORE_ADJ env var#4478
biagiopietro wants to merge 2 commits into
actions:mainfrom
biagiopietro:feat/disable-oom-score-adj-env-var

Conversation

@biagiopietro
Copy link
Copy Markdown

Summary

  • Adds ACTIONS_RUNNER_DISABLE_OOM_SCORE_ADJ environment variable (accepts true or 1) to suppress writes to /proc/<pid>/oom_score_adj;
  • Targets unprivileged containerized runners (e.g. Actions Runner Controller on Kubernetes) where the runner has no access to procfs and receives System.UnauthorizedAccessException on every spawned process;
  • When the variable is set, a Verbose trace is emitted so operators can confirm the skip is active.

Test plan

  • Existing OomScoreAdjIsWriten_Default, OomScoreAdjIsWriten_FromEnv, and OomScoreAdjIsInherited tests continue to pass (no env var set → behaviour unchanged)
  • New OomScoreAdjIsSkipped_WhenDisableEnvVarSet test: sets ACTIONS_RUNNER_DISABLE_OOM_SCORE_ADJ=true, runs a child process, and asserts its oom_score_adj equals the parent's value (i.e. no write occurred)
  • Manually verify on an unprivileged Linux container that no UnauthorizedAccessException is raised when the variable is set

Linked issues

…RE_ADJ env var

Unprivileged containerized runners (e.g. ARC on Kubernetes) cannot write
to /proc/<pid>/oom_score_adj and raise System.UnauthorizedAccessException.
Setting ACTIONS_RUNNER_DISABLE_OOM_SCORE_ADJ=true (or =1) suppresses the
write entirely so operators are not flooded with access-denied exceptions
when they know the container is already securely isolated.
@biagiopietro biagiopietro requested a review from a team as a code owner June 4, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants