Repository navigation
fix(host): treat a container CLI that can't start as an error - #107
Merged
Merged
Conversation
The container driver read every failure other than a timeout as "not there": an image that `image inspect` couldn't look at was missing, and a sandbox that `inspect` couldn't look at was gone. When the CLI itself couldn't start (missing, not executable, "Text file busy"), the host pulled images it had, fell back to `latest`, and took sandboxes it couldn't stop or remove for stopped and removed. Spawn errors are now a type of their own, NotStarted, with the messages they had. image(), state() (exists, ensure, stop, remove), create() and pull_or_fallback() pass them on instead of reading them as absence.
kalaspuff
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The container driver read every failed command other than a timeout as "not there". When the
dockerorcontainerCLI itself couldn't start (missing, not executable, or "Text file busy" as in #100), that meant:image()said the image wasn't here, sorefreshwent on to pull it orlatest. This is the second item of A host test fails at random when the fake CLI's script is busy #100, and what madethe_host_leaves_a_current_build_as_it_ispull on CI.state()said the sandbox didn't exist, sostop()andremove()returned without doing anything. A sweep then logged "removed fctl-ses-…" and forgot when the sandbox stopped, while it was still there.latest, and failed with "… is not on this host and can't be pulled".fctl host image pullsaid the image "can't be pulled, and neither can"latest.What changed
Spawn errors are now a type of their own,
NotStarted(crates/fctl-host/src/driver/mod.rs), with the same messages as before.unanswered(e)says whether a failure leaves the question open: the command couldn't start, or ran out of time.image(),state()andcreate()now pass both on as errors, as they already did timeouts, andpull_or_fallback()doesn't fall back when the CLI couldn't start. The host now reports, for instance,running docker: Permission denied (os error 13).Two places still read any failure as "not here":
has_image()stays abool. Where a failure leads somewhere (creating a sandbox, falling back tolatest), the code checks the failed command's own error first.vm_disk_free_mb()still tries the next image after any failure. Whichever image runsdfmeasures the same disk, so a CLI that fails to start once costs nothing there.The Lima driver ignores every error from
limactl stopanddelete, which is a question of its own.docs/architecture.mdnow says what the host does with a command that can't start, next to commands that hang.How I verified it
nothing_is_missing_when_the_cli_cannot_start, takes away the stand-in CLI's execute permission and checksimage,exists,stop,remove,ensure,createandpull_or_fallback. Each fails with the start error, and nothing is pulled or logged as a fallback. Undoing any one of the four changes makes it fail.cargo xtask check --quickpasses, and none of 200 runs of fctl-host's tests failed.Compatibility
Host only, no protocol change: it ships with the next release.
Fixes #100
Session: https://app.fctl.sh/s/ses_01M5AFQJTX6FENQJJZWRD5AP5K