Skip to content

Set GOMEMLIMIT from container memory limit#319

Open
fwiesel wants to merge 1 commit into
mainfrom
set-gomemlimit
Open

Set GOMEMLIMIT from container memory limit#319
fwiesel wants to merge 1 commit into
mainfrom
set-gomemlimit

Conversation

@fwiesel

@fwiesel fwiesel commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Without GOMEMLIMIT the Go GC is unaware of the container limit and may
let the heap grow until the kernel OOM-kills the process.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@fwiesel, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 3 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5deb0eb8-0ce5-4ec5-b037-d12216a6f910

📥 Commits

Reviewing files that changed from the base of the PR and between 441452b and 15714f5.

📒 Files selected for processing (1)
  • charts/openstack-hypervisor-operator/templates/deployment.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch set-gomemlimit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/api/v1 0.00% (ø)
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller 69.37% (+0.39%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/api/v1/hypervisor_types.go 0.00% (ø) 0 0 0
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/constants.go 0.00% (ø) 0 0 0
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/gardener_node_lifecycle_controller.go 63.95% (-8.46%) 86 (+28) 55 (+13) 31 (+15) 👎
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/hypervisor_controller.go 81.08% (+5.41%) 111 (+37) 90 (+34) 21 (+3) 👍
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/offboarding_controller.go 73.91% (+2.04%) 69 (+5) 51 (+5) 18 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/gardener_node_lifecycle_controller_test.go
  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/hypervisor_controller_test.go
  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/offboarding_controller_test.go

mchristianl
mchristianl previously approved these changes Jun 19, 2026
Without GOMEMLIMIT the Go GC is unaware of the container limit and may
let the heap grow until the kernel OOM-kills the process.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Helm deployment for the controller-manager to set GOMEMLIMIT from the container’s configured memory limit so the Go GC can respect cgroup/container limits and reduce OOM-kill risk.

Changes:

  • Add a GOMEMLIMIT environment variable to the controller-manager container, sourced from limits.memory via resourceFieldRef.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +50 to +53
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
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.

3 participants