Skip to content

fix: Windows hyperlight networking — use host-side poll fix - #596

Closed
danbugs wants to merge 2 commits into
microsoft:mainfrom
danbugs:fix/hyperlight-net-polling
Closed

fix: Windows hyperlight networking — use host-side poll fix#596
danbugs wants to merge 2 commits into
microsoft:mainfrom
danbugs:fix/hyperlight-net-polling

Conversation

@danbugs

@danbugs danbugs commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix urlopen() without an explicit timeout hanging in Hyperlight micro-VMs on Windows.

  • Point hyperlight-unikraft at the fix/wsapoll-pollout-spin branch (hyperlight-unikraft PR #105) which fixes Windows networking read-readiness detection
  • Includes v0.11.0 API adaptation (snapshot directory format, max_surrogates, Runtime::new signature)

The existing hyperlight_networking.json e2e test (urlopen('http://example.com/') without timeout) verifies this fix — it was timing out at 30s without the host-side changes (see PR #591 CI failure).

What PR #105 changes on the host side

  • WSAPollselect(): WSAPoll has known POLLRDNORM reliability issues on Windows
  • Check writefds in hl_sleep_poll_sockets: POLLOUT was never reported, breaking settimeout() paths
  • 50ms minimum poll timeout: prevents the guest busy-polling net_poll(timeout_ms=0) from starving readiness detection
  • Restore SO_RCVTIMEO/SO_SNDTIMEO after connect_timeout() which clears them

Relationship to the Unikraft kernel fix

A complementary kernel-level fix (unikraft fix/net-poll-sleep) registers a halt_irq PM ops callback so the cooperative scheduler's idle thread polls sockets via __hl_sleep instead of doing a no-op spinwait. This fixes the root cause (scheduler not polling during idle), while PR #105 fixes independent Windows host-side bugs. Both should land.

Test plan

  • Existing hyperlight_networking.json e2e test exercises urlopen() without timeout
  • CI green on hyperlight-e2e.yml (Windows)
Microsoft Reviewers: Open in CodeFlow

danbugs added 2 commits June 29, 2026 20:50
Signed-off-by: danbugs <danilochiarlone@gmail.com>
… polling

Point the hyperlight-unikraft dependency at the fix/wsapoll-pollout-spin
branch which replaces WSAPoll with select() on Windows and adds a 50ms
minimum poll timeout when read-readiness is checked. This fixes
urlopen() without an explicit timeout hanging in the micro-VM.

Signed-off-by: danbugs <danilochiarlone@gmail.com>
Copilot AI review requested due to automatic review settings June 30, 2026 19:10
@danbugs
danbugs requested a review from a team as a code owner June 30, 2026 19:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 MXC’s Hyperlight backend wiring to consume Hyperlight host-side networking fixes (to prevent urlopen() without explicit timeouts from hanging in Windows Hyperlight micro-VMs) while also adapting the integration to the v0.11.x API/snapshot layout.

Changes:

  • Switch Hyperlight backend dependency from the old hyperlight-unikraft-host source to the hyperlight-unikraft git branch containing the Windows poll readiness fixes.
  • Update snapshot handling from a single file (snapshot.hls) to a directory format (snapshot/index.json) across the backend and E2E prereq checks.
  • Update CI Hyperlight E2E workflow to pull the v0.11.0 kernel/initrd images.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/testing/wxc_e2e_tests/src/lib.rs Updates the Windows Hyperlight snapshot prereq probe to the new snapshot/index.json layout.
src/backends/hyperlight/common/src/lib.rs Adapts Hyperlight runner integration to hyperlight-unikraft and v0.11.x API changes (snapshot dir + new options + Runtime::new signature).
src/backends/hyperlight/common/Cargo.toml Updates the Hyperlight dependency to a git branch providing the host-side networking fix.
src/Cargo.lock Locks in the updated Hyperlight dependency graph (including moving to hyperlight-unikraft and new transitive deps).
.github/workflows/hyperlight-e2e.yml Updates the GHCR image tag used to download Hyperlight kernel/initrd for Windows E2E.

Comment on lines 10 to +11
[target.'cfg(target_arch = "x86_64")'.dependencies]
hyperlight-unikraft-host = { git = "https://github.com/hyperlight-dev/hyperlight-unikraft", tag = "v0.10.0", optional = true }
hyperlight-unikraft = { git = "https://github.com/hyperlight-dev/hyperlight-unikraft.git", branch = "fix/wsapoll-pollout-spin", optional = true }
Comment on lines +246 to 247
let snapshot = home.join("pyhl").join("snapshot").join("index.json");
if snapshot.is_file() {
@danbugs danbugs closed this Jun 30, 2026
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