Skip to content

fix(maxprocs): treat ConfigureMaxProcs error as non-fatal#7655

Merged
JorTurFer merged 1 commit intokedacore:mainfrom
ManvithaP-hub:fix/maxprocs-non-fatal-7653
Apr 22, 2026
Merged

fix(maxprocs): treat ConfigureMaxProcs error as non-fatal#7655
JorTurFer merged 1 commit intokedacore:mainfrom
ManvithaP-hub:fix/maxprocs-non-fatal-7653

Conversation

@ManvithaP-hub
Copy link
Copy Markdown
Contributor

Summary

KEDA pods crash on startup with failed to set max procs: open /sys/fs/cgroup/cpu.max: permission denied in environments where the operator cannot read cgroup files (e.g. EKS auto-mode, restricted SecurityContexts).

Root Cause

maxprocs.Set() from go.uber.org/automaxprocs returns an error when it can't read /sys/fs/cgroup/cpu.max, and all three KEDA entry points (operator, webhooks, adapter) treat this as fatal.

Fix

Log the error as a warning and continue startup. The Go runtime will use a sensible default GOMAXPROCS value, so this is not actually a fatal condition.

Applied the same fix to all three entry points:

  • cmd/operator/main.go
  • cmd/webhooks/main.go
  • cmd/adapter/main.go

Validation

  • go build ./cmd/operator/ ./cmd/webhooks/ ./cmd/adapter/ succeeds

Fixes #7653

@ManvithaP-hub ManvithaP-hub requested a review from a team as a code owner April 15, 2026 12:53
@github-actions
Copy link
Copy Markdown

Thank you for your contribution! 🙏

Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected.

While you are waiting, make sure to:

  • Add an entry in our changelog in alphabetical order and link related issue
  • Update the documentation, if needed
  • Add unit & e2e tests for your changes
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient.

Learn more about our contribution guide.

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Apr 15, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@colineinfalt
Copy link
Copy Markdown

@ManvithaP-hub , it looks like there are three checks queued for more than five days.
Tagging to bring attention to this.

When KEDA runs in environments where /sys/fs/cgroup/cpu.max is not
readable (e.g. EKS auto-mode, restricted SecurityContexts), maxprocs.Set()
returns a permission error and KEDA crashes on startup.

The Go runtime handles GOMAXPROCS sensibly without explicit configuration,
so this error should not be fatal. Log it as a warning and continue
startup.

Fixes kedacore#7653

Signed-off-by: ManvithaP-hub <62259625+ManvithaP-hub@users.noreply.github.com>
@ManvithaP-hub ManvithaP-hub force-pushed the fix/maxprocs-non-fatal-7653 branch from d2e83e9 to 5d200bf Compare April 21, 2026 16:18
@ManvithaP-hub
Copy link
Copy Markdown
Contributor Author

ManvithaP-hub commented Apr 22, 2026

@ManvithaP-hub , it looks like there are three checks queued for more than five days. Tagging to bring attention to this.

@colineinfalt : Thanks for looking into this. It looks like the ARM smoke tests have been running for 11+ hours and S390x/e2e tests are still queued. This seems like a runner availability issue rather than anything wrong with the PR. Is there a way to re-trigger the stuck checks?

ARM smoke tests --> running (started 11h ago —> this is the slow one)
S390x smoke tests --> queued/pending
e2e tests --> queued/pending

@rickbrouwer
Copy link
Copy Markdown
Member

These are the E2E tests. They can only be started by Reviewers or Maintainers. We do this once we have reviewed a PR.

@JorTurFer
Copy link
Copy Markdown
Member

JorTurFer commented Apr 22, 2026

/run-e2e internal
Update: You can check the progress here

@rickbrouwer rickbrouwer added the ok-to-merge This PR can be merged label Apr 22, 2026
@JorTurFer JorTurFer merged commit 6abd2fb into kedacore:main Apr 22, 2026
25 checks passed
@JorTurFer
Copy link
Copy Markdown
Member

Thanks a lot for the fix!

Abhicodeitout pushed a commit to Abhicodeitout/keda that referenced this pull request May 1, 2026
)

When KEDA runs in environments where /sys/fs/cgroup/cpu.max is not
readable (e.g. EKS auto-mode, restricted SecurityContexts), maxprocs.Set()
returns a permission error and KEDA crashes on startup.

The Go runtime handles GOMAXPROCS sensibly without explicit configuration,
so this error should not be fatal. Log it as a warning and continue
startup.

Fixes kedacore#7653

Signed-off-by: ManvithaP-hub <62259625+ManvithaP-hub@users.noreply.github.com>
Abhicodeitout pushed a commit to Abhicodeitout/keda that referenced this pull request May 1, 2026
)

When KEDA runs in environments where /sys/fs/cgroup/cpu.max is not
readable (e.g. EKS auto-mode, restricted SecurityContexts), maxprocs.Set()
returns a permission error and KEDA crashes on startup.

The Go runtime handles GOMAXPROCS sensibly without explicit configuration,
so this error should not be fatal. Log it as a warning and continue
startup.

Fixes kedacore#7653

Signed-off-by: ManvithaP-hub <62259625+ManvithaP-hub@users.noreply.github.com>
Signed-off-by: Abhishek Kumar Kushwaha <abhithegabbar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-merge This PR can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to set max procs - keda failing to startup

4 participants