mirror of
https://github.com/games-on-whales/wolf.git
synced 2026-10-15 13:02:03 +00:00
[PR #537] fix(rest): pause the old session's pipeline on resume #509
Labels
No labels
🧠 1 - 🤖 999
AMD
bug
bug
cannot reproduce
documentation
duplicate
easy
enhancement
enhancement
enhancement
fixed?
fixed?
good first issue
hard
help wanted
Intel
invalid
LXC
medium
moonlight-protocol
Multi GPU
nixos
not a bug
nvidia
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/wolf#509
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/wolf/pull/537
Author: @jdonaldson
Created: 10/10/2026
Status: 🔄 Open
Base:
stable← Head:fix/resume-pause-old-pipeline📝 Commits (1)
136f0d1fix(rest): pause the old session's pipeline on resume📊 Changes
1 file changed (+8 additions, -0 deletions)
View changed files
📝
src/moonlight-server/rest/endpoints.hpp(+8 -0)📄 Description
Follow-up to #501 / #504 / #510, on the re-entry path.
What
resume()does today (rest/endpoints.hpp): it creates a new session, moves the old session'swayland_displayand input devices onto it, and replaces the old record inrunning_sessions. It never fires an event for the old session, so the old session's video and audio pipelines are left to whatever the control channel did.Where pipelines actually get paused: only
control/control.cpp, onENET_EVENT_TYPE_DISCONNECTor on aTERMINATIONcontrol packet. Both depend on the client getting a message out before it goes away. When that doesn't happen (link drop, client crash, a phone going to sleep), the old pipeline is still running on the display the new session is about to take over, and since its session id has just leftrunning_sessions, nothing can stop it by id afterwards. That is the state in which the second pipeline's CUDA context creation collides with the first one's (theGsCUDABuf/apply_video_infopanic in #501). #505 guards the cached-context side of that race; this closes the other side.Change: fire
PauseStreamEvent{old_session->session_id}before creating the new session. It's the same event the control channel fires on disconnect, so the behaviour on resume is now the same whether or not the TERMINATION packet made it.Why this is safe
PauseStreamEventonly sends EOS to the pipeline (streaming.cpp,pause_handler); the handler's own comment states that killing the pipeline and re-creating it on resume is the only option. The app container and the Wayland display are untouched, which is what resume relies on.run_pipeline's main loop and the handler array is destroyed with it, so if the control channel already paused this session the second event finds no handler and is a no-op. No double-teardown.SETUP, so the old one has the HTTPS round trip to wind down first. That is the same slack a control-channel pause gets today.Verification
ninja wolfin thewolf-builderstage ofdocker/wolf.Dockerfilewith this header swapped in (base treestable@2273b2e+ #510, since that's the builder image I had cached; theresume()body is identical on currentstable).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.