Skip to content

feat(tart)!: remove the warm pool - #103

Merged
ysya merged 5 commits into
mainfrom
feat/remove-tart-warm-pool
Dec 1, 2026
Merged

ysya merged 5 commits into
mainfrom
feat/remove-tart-warm-pool

Conversation

@ysya

@ysya ysya commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Last of four stacked PRs. Stacked on #102; merge that first.

Why

The warm pool kept booted VMs ready inside the Tart provider. That was a second scheduler, in a place the controller could not see:

  • It bypassed capacity accounting. Warm VMs held host VM slots without a capacity lease, so the controller's view of free capacity was wrong.
  • It kept twice the configured number. The pool channel is buffered, so a worker that put its VM in the channel went on to boot another and held it. A stand-in tart test showed two running VMs for pool-size = 1. On a macOS host that is both VM slots. Two macOS scale sets with pool-size = 1 each pass validation, and one of them could take both slots and leave the other without a VM for good.
  • It duplicated min-runners, which keeps capacity ready in the controller, and keeps a runner that is already online when its job arrives. A warm VM still had to start its runner.
  • Most recent Tart lifecycle bugs came from it: shutdown waiting on pool workers, a pool left running after a failed startup, VMs handed over after the pool was emptied.

The pool predates min-runners = "auto".

What changes

  • Every Tart start is a fresh clone and boot. StartPool, the pool workers and their retry bookkeeping are gone, and Shutdown only ends the VMs that are still running.
  • A Linux scale set runs at most max-runners VMs (it was max-runners + pool-size).
  • The macOS checks on pool-size are gone; the ones on min-runners stay.
  • VMs named like warm-pool VMs are still removed at startup, so an upgrade cleans up what the previous version left behind.
  • README, the configuration and command docs, the example config, the site's config builder and guide, and their fixtures no longer mention the pool.

Breaking change

[tart] pool-size and --tart-pool-size are removed. A config that still sets pool-size, even to 0, does not load:

config key "tart.pool-size" has been removed; remove it and set min-runners to keep runners ready

This follows how the repository treats other retired keys: an error, not a silently ignored setting.

To migrate, remove the key. To keep a runner ready before a job arrives, set min-runners to a fixed count, or to "auto" for one spare while there is demand.

Tests

  • TestRetiredConfigKeysFailWithoutUsingTheirValues gains three cases for tart.pool-size, and TestRetiredCommandsAndFlagsAreUnavailable checks the flag. Both failed before the change.
  • The Linux VM bound test now expects max-runners.
  • Tests that only exercised the pool are removed.

go test ./... -race, go vet ./..., golangci-lint run ./..., node --test scripts/full-config.test.mjs and python3 scripts/check-site.py pass.

Verified on a Tart host

An Apple silicon host with tart 2.40.1 and a macOS guest, with a stand-in for the runner. All five remaining TestTartIntegration_ tests passed with this change, and no VM or tart run process was left behind.

Not verified

  • A real runner and real jobs from GitHub.
  • Linux guests, bridged networking and Softnet.

ysya added 4 commits December 2, 2026 01:30
Tart can create the clone and still fail, for example when a cancelled
context kills the command. Nothing tracked that VM yet, so it stayed on
disk until the next start of runscaler removed it as an orphan. A warm pool
that was shut down while a worker was cloning its next VM left one behind
about one time in three.

A failed clone is now deleted, with a deadline. A clone refused by the
free-space floor never reached Tart, and one Tart refused because the name
is taken left a VM that belongs to someone else, so neither is deleted.
…eal VMs

The Tart tests answered every command from a mock inside the test process,
which cannot show what ends a `tart run` or whether anything waits for it.

A stand-in `tart` shell script now lets three tests run the provider
through os/exec. They run in CI on Linux and macOS and fail if a VM's
process dies with its start context, or if Shutdown returns before the
processes it killed are gone.

The `TestTartIntegration_` tests boot VMs with the real `tart` and skip
unless RUNSCALER_TEST_TART_IMAGE is set. No CI can run them, because Tart
needs Apple silicon and hosted Apple silicon runners cannot nest a VM.
scripts/prepare-tart-test-image.sh prepares their base image with a
stand-in for the Actions runner, so they register nothing with GitHub.
docs/development.md says when and how to run them.
A Tart VM keeps running when the runner inside it exits. WaitInstance only
watched the VM, so a runner that died while idle stayed counted as an idle
runner for good. On a macOS host, with its two VM slots, that silently took
half of the capacity. Docker has no such gap, because the runner is the
container's main process.

WaitInstance now also checks the runner process every 20 seconds and
returns once three checks in a row found none. One or two misses are
tolerated, since the runner is briefly absent while it restarts to update
itself, and a check that could not reach the guest counts as neither. The
VM is left running: the controller removes it, as it does for any instance
that exited.
The warm pool kept booted VMs ready inside the Tart provider, where the
controller could not see them. They held host VM slots without a capacity
lease, so the controller's view of free capacity was wrong, and a pool of
size N kept up to 2N VMs running: on a macOS host, pool-size = 1 took both
VM slots, and two macOS scale sets with a pool each could leave one of them
without a VM for good.

min-runners already keeps capacity ready, in the controller, and keeps a
runner that is online when its job arrives rather than a VM that still has
to start one. Every Tart start is now a fresh clone and boot.

A Linux scale set runs at most max-runners VMs. VMs named like warm-pool
VMs are still removed at startup, so an upgrade cleans up what the previous
version left behind.

BREAKING CHANGE: `[tart] pool-size` and `--tart-pool-size` are removed. A
config that still sets `pool-size`, even to 0, does not load. Remove the
key and set `min-runners` to keep runners ready before a job arrives.
Base automatically changed from fix/tart-runner-liveness to main December 1, 2026 19:33
@ysya
ysya merged commit c3e716e into main Dec 1, 2026
14 checks passed
@ysya
ysya deleted the feat/remove-tart-warm-pool branch December 1, 2026 19:38
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.

1 participant