8000 fix(minvmd): raise RLIMIT_NOFILE in the VMM child before boot by gominimal-aw-bot[bot] · Pull Request #1740 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minvmd): raise RLIMIT_NOFILE in the VMM child before boot - #1740

Merged
norrietaylor merged 1 commit into
mainfrom
inbox-patch/fix/vmm-child-nofile-limit-d3998e4ec8729307
Sep 29, 2026
Merged

norrietaylor merged 1 commit into
mainfrom
inbox-patch/fix/vmm-child-nofile-limit-d3998e4ec8729307

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Sep 26, 2026 •
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABTSyXSw

Defect

Bursts of min session exec open one vsock connection per exec, and libkrun holds each closed connection ~5 s before freeing it. The VMM child inherits the parent's default 256-fd soft limit, so a burst exhausts it and every exec fails for those 5 s.

Change

Raise the soft and hard RLIMIT_NOFILE to 64 Ki at the start of the VMM child (run_vmm), before any fd-heavy work, mirroring the helper minimald's guest pid-1 already uses. Best-effort: a VM that boots with the default limit beats one that does not boot.

Verification

  • cargo fmt --all --check — clean
  • cargo clippy -p minvmd --locked -- -D warnings — clean
  • cargo build --workspace --locked — clean
  • cargo test -p minvmd --locked — clean
  • live-session: macos e2e — runs on this PR; not runnable in the fixer sandbox

Summary by CodeRabbit

  • Bug Fixes
    • VM startup now attempts to raise the child process’s open-file limit to 65,536 before resolving image paths. If the current limit is already high enough, it remains unchanged. If the limit cannot be raised, startup continues, and the issue is logged as a warning instead of preventing the VM from booting.

Bursts of `min session exec` open one vsock connection per exec, and
libkrun holds each closed connection ~5 s before freeing it. The VMM
child inherits the parent's default 256-fd soft limit, so a burst
exhausts it and every exec fails for those 5 s.

Raise the soft and hard RLIMIT_NOFILE to 64 Ki at the start of the VMM
child, before any fd-heavy work, mirroring the helper minimald's guest
pid-1 already uses. Best-effort: a VM that boots with the default limit
beats one that does not boot.
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner September 26, 2026 09:11
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Sep 26, 2026
@coderabbitai
coderabbitai Bot commented Sep 26, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 41a66ec8-d7cf-4025-9aac-871d0a928f6f

📥 Commits

Reviewing files that changed from the base of the PR and between 3c17671 and f7f8770.

📒 Files selected for processing (1)
  • crates/minvmd/src/cmd/vmm_child.rs

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The VMM child now attempts to raise its RLIMIT_NOFILE to 65,536 before resolving VM image paths. If the attempt fails, it logs a warning and continues startup.

Changes

VMM file descriptor limit

Layer / File(s) Summary
Read and apply the file descriptor limit
crates/minvmd/src/cmd/vmm_child.rs
The new helpers read and set RLIMIT_NOFILE. The limit-setting logic keeps an existing soft limit of at least 65,536, otherwise tries 65,536 and falls back to the inherited hard limit. run_vmm logs failures and continues startup.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: norrietaylor

Merge Risk: ⚪ Minimal · up to f7f87

No identified issue prevents merging after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the fix, the affected component, and the specific RLIMIT_NOFILE change. It follows the required Conventional Commit format.
Description check ✅ Passed The description explains the defect, the change, and the verification results. It does not use the template headings or include the checklist, but it provides the required core information and is most…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

A rabbit checks the limit high,
Then watches startup pass it by.
If setting fails, a warning sounds,
The VMM still keeps its rounds.
Soft and hard limits find their place,
While bunny hops at boot-time pace.

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

@gominimal-aw-bot gominimal-aw-bot Bot added the agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch label Sep 26, 2026
@norrietaylor norrietaylor changed the title fix: fix(minvmd): raise RLIMIT_NOFILE in the VMM child before boot fix(minvmd): raise RLIMIT_NOFILE in the VMM child before boot Sep 28, 2026
@norrietaylor
norrietaylor merged commit 285c846 into main Sep 29, 2026
32 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/fix/vmm-child-nofile-limit-d3998e4ec8729307 branch September 29, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0