bug(vm-driver): VM sandbox cold start stalls ~5 s repeatedly on "Waiting for VM supervisor"
維護者通常 1 天內回覆
已經有一個關聯 PR 被合併了。
- #4282 來自 @benoitf —— 已合併
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 82/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- rust
研究方向
從 crates/openshell-driver-vm/runtime/pins.env 開始,檢查 VM 執行時如何釘選 libkrun 的 pin。將 pin 更新為包含上游拒絕連線修復的版本,接著使用回報的重現步驟建立 VM 沙箱。完成意味著執行時使用已修復的版本,且沙箱建立在等待 VM 監管器時不再停頓約 5 秒。
由索引模型根據 Issue 內容生成。
描述
Note: I have observed the behaviour, but due to lacking Rust knowledge and the codebase in general I have instructed Claude Opus 5.5 to use the skills in this repo and analyze for potential cause of the 5s wait. "Analysis by Claude" is added where the statements are from Claude, and I have verified the parts I am able to (commit references etc).
User Story
I use OpenShell for running ephemeral sandboxes. I directly encountered repeatedly a 5 second wait on "Waiting for VM supervisor". I need sandboxes to become ready without this wait, so that they start faster and the task can be done quicker.
⠐ Starting sandbox... Waiting for VM supervisor (0s)
⠐ Starting sandbox... Waiting for VM supervisor (5s)
Problem Statement
Analysis by Claude:
VM sandbox startup can stall for about 5 seconds while the host waits to reach the guest over the boundary control connection.
The VM driver maps its boundary control port with krun_add_vsock_port2(..., listen=true). libkrun accepts the host-side Unix socket connection immediately, before anything in the guest listens on that port. In libkrun v1.19.4 and earlier, when the guest refuses that connection, libkrun keeps the host socket open until its reaper reclaims it 5 s later. connect_boundary_with_retry in openshell-sandbox-backend therefore blocks for that window instead of retrying every 25 ms.
Upstream fixed this in libkrun/libkrun@d2d8dd6 ("virtio/vsock: remove refused connections without waiting for the reaper"), first released in v1.19.5 (upstream issue containers/libkrun#684). OpenShell pins libkrun v1.19.4 in crates/openshell-driver-vm/runtime/pins.env.
Impact / Why This Matters
Analysis by Claude:
Every VM sandbox whose host-side probe reaches the control socket before the guest is listening pays up to ~5 s of extra startup time. The delay dominates cold start for short-lived sandboxes. There is no workaround in OpenShell configuration. Upstream measured time to first round trip after VM start at 5338 ms before the fix and 415 ms after, with a blocking probe.
Acceptance Criteria
- The VM driver runtime is built with a libkrun release that contains libkrun/libkrun@d2d8dd6. (1.19.5 or 1.19.6 atm)
- VM sandbox creation no longer includes a ~5 s stall
Reproduction Steps
openshell sandbox create --name sandbox
Created sandbox: sandbox
✓ Sandbox allocated (0s)
✓ Image pulled (512 MB) (0s)
⠤ Starting sandbox... Waiting for VM supervisor (5s)
Suggested UX (if applicable)
No response
Environment
- OpenShell: openshell 0.1.2
- OS: macOS 26.6.2 (Apple silicon)
- OpenShell deployment mode and runtime: local gateway, VM compute driver (libkrun v1.19.4)
Logs
Created sandbox: sandbox
✓ Sandbox allocated (0s)
✓ Image pulled (512 MB) (0s)
⠤ Starting sandbox... Waiting for VM supervisor (5s)
- 主要語言
- Rust
- 星號
- 16.3k
- 分支
- 1.8k
- 平均合併
- 2 天 5 小時
- 30 天內合併 PR
- 383
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NVIDIA/OpenShell 的其他 Issue
-
bug(sdk/go): browser login callback binds 127.0.0.1 but redirect_uri uses localhost可能重新可做 關聯的 PR 已關閉且未合併。 未關閉state:triage-needed
難度 2/5 1-3 小時 新手友好度 65/100
NVIDIA/OpenShell#4518 · 1 則留言 ·
維護者通常 1 天內回覆
-
state:triage-needed
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
bug(sdk/go): edge (Cloudflare Access) token is cached for the client lifetime and never reloaded未關閉state:triage-needed
難度 2/5 1-3 小時 新手友好度 72/100
NVIDIA/OpenShell#4515 · 1 則留言 ·
維護者通常 1 天內回覆
-
state:triage-needed
難度 2/5 1-3 小時 新手友好度 72/100
NVIDIA/OpenShell#4509 · 1 則留言 ·
維護者通常 1 天內回覆
-
state:triage-needed
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
相似的 Issue
-
area:ecosystem documentation
難度 2/5 1-3 小時 新手友好度 78/100
Chelis-Lang/chelis#3866 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 68/100
metasequoiaime/msime#8620 ·
維護者通常 1 天內回覆
-
agent-detection macos p2 triaged
難度 1/5 1 小時以內 新手友好度 90/100
維護者通常 1 天內回覆
-
bug documentation sev-0
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆