Skip to content

Pause/Resume containers - #305

Open
Murazaki wants to merge 3 commits into
games-on-whales:stablefrom
Murazaki:feature/pause_containers
Open

Pause/Resume containers#305
Murazaki wants to merge 3 commits into
games-on-whales:stablefrom
Murazaki:feature/pause_containers

Conversation

@Murazaki

@Murazaki Murazaki commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Attempt at enabling pause/resume scheme from Wolf to Wolf UI.

As discussed on Discord, this might not work perfectly has pausing containers doesn't free GPU VRAM, since there's no cgroup freeze method available to do so by default. There is hope that we could do it with some research, and it might come to the kernel in the next years, but for now we have to try without. This might end up creating crashes though.

I'm still not sure of the return values that Resume should give. I kept it as a separated action from Join for now, but maybe the scheme would be better if we could directly join ?

I also might have connected pause and resume stream events to pause/resume container, which depending on how this works might not be a good idea.

Linked to games-on-whales/wolf-ui#10

@Murazaki
Murazaki marked this pull request as draft December 3, 2025 02:19
@Murazaki Murazaki changed the title [Draft] Pause/Resume containers Pause/Resume containers Dec 3, 2025
@ABeltramo
ABeltramo marked this pull request as ready for review December 3, 2025 08:06

@ABeltramo ABeltramo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, looks good! Just a couple of notes and small changes from my side.

Also, I would prefer to remove all the extra .envrc and nix files if you can.

if (std::to_string(pause_ev->session_id) == session_id) {
docker_api.pause_by_id(container_id);
}
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't handle PauseStreamEvent (andResumeLobbyEvent below) . For single users this can potentially break apps and for lobbies it will pause an entire lobby when any participant exits which you definitely don't want to happen.

Comment thread src/moonlight-server/sessions/lobbies.cpp Outdated
Comment thread src/moonlight-server/events/events.hpp Outdated
Comment thread src/moonlight-server/api/unix_socket_server.cpp Outdated
@ABeltramo

Copy link
Copy Markdown
Member

Also the following condition

while (docker_api.get_by_id(container_id)->status == RUNNING)

should probably be changed: when we get out of that loop, we'll stop the container and trigger the chain of events that will end the lobby.

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