[PR #9] [CLOSED] [moonlight-proxy] raise launch wait from 25s to 120s #11

Closed
opened 2026-10-15 12:46:37 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/fenrir/pull/9
Author: @shrinedogg
Created: 6/13/2026
Status: ❌ Closed

Base: main ← Head: fix/launch-cold-start-timeout


📝 Commits (9)

  • b5df617 [operator] retry stream reconciliation and fix stale session tracking
  • 0f5d768 [moonlight-proxy] raise launch wait from 25s to 120s
  • fd91750 [wolf-agent] act as fake-udev for hotplugged input devices
  • 2828835 [moonlight-proxy] raise launch wait from 25s to 120s
  • 6fdace7 Fix malformed json struct tag on RuntimeWolfVariables.RenderNode
  • bb77b02 [moonlight-proxy] make launch timeout configurable
  • cf3cf47 Merge branch 'games-on-whales:main' into main
  • 8e6abf5 Merge branch 'main' into fix/launch-cold-start-timeout
  • fca375e Merge branch 'games-on-whales:main' into fix/launch-cold-start-timeout

📊 Changes

13 files changed (+461 additions, -17 deletions)

View changed files

📝 README.md (+14 -2)
📝 cmd/moonlight-proxy/main.go (+6 -3)
📝 go.mod (+2 -3)
📝 go.sum (+0 -2)
📝 pkg/controllers/agent.go (+84 -0)
📝 pkg/controllers/session.go (+25 -3)
➕ pkg/fakeudev/fakeudev.go (+173 -0)
➕ pkg/fakeudev/fakeudev_linux.go (+26 -0)
➕ pkg/fakeudev/fakeudev_other.go (+9 -0)
➕ pkg/fakeudev/fakeudev_test.go (+54 -0)
📝 pkg/generic/controller.go (+9 -1)
📝 pkg/moonlight/rest.go (+20 -2)
📝 pkg/wolfapi/client.go (+39 -1)

📄 Description

Problem

launchHandler waits for the direwolf controller to create the session before returning the stream URL, but the poll budget is only 25s:

err = wait.PollUntilContextTimeout(r.Context(), 250*time.Millisecond, 25*time.Second, true, func(ctx context.Context) (bool, error) {
    session, err := s.SessionClient.Get(ctx, session.Name, metav1.GetOptions{})
    ...
})

A cold session start routinely exceeds that: pulling a multi-GB app image, booting Wolf, and waiting for wolf-agent readiness easily takes 30–60s. When the 25s budget runs out, /launch returns 500 right before the pod becomes ready; the Moonlight client then cancels and the half-started session is torn down. In practice the first launch of an app fails almost every time.

Fix

  • Raise the /launch poll budget from 25s to 120s.

The poll is bound to r.Context(), so if the Moonlight client gives up and disconnects the wait is still cancelled early — the larger timeout only extends the patient path, it does not hold anything open after the client has left.

Testing


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/fenrir/pull/9 **Author:** [@shrinedogg](https://github.com/shrinedogg) **Created:** 6/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/launch-cold-start-timeout` --- ### 📝 Commits (9) - [`b5df617`](https://github.com/games-on-whales/fenrir/commit/b5df617aaa69b8d15001915a170d1a9fd8028bb5) [operator] retry stream reconciliation and fix stale session tracking - [`0f5d768`](https://github.com/games-on-whales/fenrir/commit/0f5d7687ce1734764666fa19a2fba45f543f8315) [moonlight-proxy] raise launch wait from 25s to 120s - [`fd91750`](https://github.com/games-on-whales/fenrir/commit/fd91750567dc038b0f608bd86be7bb335601aab0) [wolf-agent] act as fake-udev for hotplugged input devices - [`2828835`](https://github.com/games-on-whales/fenrir/commit/28288350ce85f16a2e95eee302d9ab58f623927d) [moonlight-proxy] raise launch wait from 25s to 120s - [`6fdace7`](https://github.com/games-on-whales/fenrir/commit/6fdace77999784d8a3f8b6197edac99418f24850) Fix malformed json struct tag on RuntimeWolfVariables.RenderNode - [`bb77b02`](https://github.com/games-on-whales/fenrir/commit/bb77b0234dfb73753863cbfa1ab013cf0f4751e6) [moonlight-proxy] make launch timeout configurable - [`cf3cf47`](https://github.com/games-on-whales/fenrir/commit/cf3cf471eccb128ab81c640165ed33dd5cd70bb5) Merge branch 'games-on-whales:main' into main - [`8e6abf5`](https://github.com/games-on-whales/fenrir/commit/8e6abf5521c59b94941848daab59c0893397855e) Merge branch 'main' into fix/launch-cold-start-timeout - [`fca375e`](https://github.com/games-on-whales/fenrir/commit/fca375eb4c8519d1c68ae10a108b7a8e952d1e9d) Merge branch 'games-on-whales:main' into fix/launch-cold-start-timeout ### 📊 Changes **13 files changed** (+461 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+14 -2) 📝 `cmd/moonlight-proxy/main.go` (+6 -3) 📝 `go.mod` (+2 -3) 📝 `go.sum` (+0 -2) 📝 `pkg/controllers/agent.go` (+84 -0) 📝 `pkg/controllers/session.go` (+25 -3) ➕ `pkg/fakeudev/fakeudev.go` (+173 -0) ➕ `pkg/fakeudev/fakeudev_linux.go` (+26 -0) ➕ `pkg/fakeudev/fakeudev_other.go` (+9 -0) ➕ `pkg/fakeudev/fakeudev_test.go` (+54 -0) 📝 `pkg/generic/controller.go` (+9 -1) 📝 `pkg/moonlight/rest.go` (+20 -2) 📝 `pkg/wolfapi/client.go` (+39 -1) </details> ### 📄 Description ## Problem `launchHandler` waits for the direwolf controller to create the session before returning the stream URL, but the poll budget is only 25s: ```go err = wait.PollUntilContextTimeout(r.Context(), 250*time.Millisecond, 25*time.Second, true, func(ctx context.Context) (bool, error) { session, err := s.SessionClient.Get(ctx, session.Name, metav1.GetOptions{}) ... }) ``` A cold session start routinely exceeds that: pulling a multi-GB app image, booting Wolf, and waiting for `wolf-agent` readiness easily takes 30–60s. When the 25s budget runs out, `/launch` returns 500 right before the pod becomes ready; the Moonlight client then cancels and the half-started session is torn down. In practice the first launch of an app fails almost every time. ## Fix * Raise the `/launch` poll budget from 25s to **120s**. The poll is bound to `r.Context()`, so if the Moonlight client gives up and disconnects the wait is still cancelled early — the larger timeout only extends the patient path, it does not hold anything open after the client has left. ## Testing * `go build ./...` and `go test ./pkg/moonlight/...` pass. * On my Talos cluster (RTX 5090, fenrir/wolf), cold starts that previously returned 500 at the 25s mark now complete on the first launch. Engineering notes: https://github.com/shrinedogg/biggs.dog#patched-fork--engineering-notes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:46:37 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/fenrir#11
No description provided.