VM can go to sleep as idle during a long /containers/create (first run of a large image): "the VM stopped"

Open
#1,140 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@takealook97 is already working on this.

Since Dec 2, 2026.

  • #1141 by @takealook97 — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, linux, rust

Research direction

Start with api.rs and trace how /containers/create interacts with touch(), start_sleeper, sleep_if_idle, awake_needed(), and hold_awake(). Compare the existing native build hold with the create and load request paths. Define the expected behavior as keeping the VM awake for the duration of a long request, then check relevant tests or add coverage for that lifecycle; linked pull request #1141 indicates work is already underway.

Written by the indexing model from the issue text.

Description

Kiri version and system

Kiri 0.3.0, Windows 11 (build 26300), WSL 2.

What you did

docker load of a 74-layer image (5.6 GB tar), then docker run --rm on it, with no other container running. The first run has to unpack the layers, which takes more than 60 s here.

What happened (seen once)
docker: Error response from daemon: the VM stopped
08:38:27.499Z INFO  VM booted ms=59 cpus=20 memory_mib=2961
08:39:37.659Z ERROR request failed method=POST path=/containers/create status=500
08:39:37.711Z INFO  VM asleep: idle; the next request wakes it idle_s=60

Keeping a small container running (docker run -d alpine sleep 1200) and repeating the run worked.

What you expected instead

A request in progress keeps the VM awake.

Anything else

I could not reproduce it in 5 later attempts (65–88 s each), but the kiri-build0 BuildKit container existed in all of them (running, paused, or started again by itself) and the VM never slept, so they are not a clean control.

From reading main (6d0c7a5): touch() runs only when a request starts (api.rs), start_sleeper/sleep_if_idle look at running containers, execs and awake_needed(), and hold_awake() is taken by native builds but not by /containers/create. The comment on hold_awake() describes the same gap for builds, so a hold around create (and other long requests such as load) may be enough.

Dominant language
Rust
Stars
7.5k
Forks
329
Avg merge
8h 54m
Merged PRs (30d)
426

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libracoder/kiri

All issues in libracoder/kiri

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.