Repository navigation
fix(minimal): finalize-install replaces a stale or failing installed minzoned, and min ls names - #3481
fix(minimal): finalize-install replaces a stale or failing installed minzoned, and min ls names#3481minimal-foundry[bot] wants to merge 7 commits into
Conversation
answerer_step_over compares the installed minzoned's SHA-256 with the shipped one and reads the service job state. A different copy or a loaded job that is not running is a step that reinstalls the service. The DNS service line names a failing service and min finalize-install.
When the port is held with no channel and the installed DNS service is stale or not running, the names item offers the reinstall step and does not report waiting. min ls and the session start name the failing service and min finalize-install.
When an upgrade ships a minzoned that differs from the installed root-owned copy, the installer offers the step the probe prints, or names min finalize-install when the probe has no script to offer.
…nstall-replaces-a-stale-or-failing-ins
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
/revise Review of head 19ede39. Fix these. Keep every change inside the plan's six files.
|
…nstall-replaces-a-stale-or-failing-ins
min ls and the session start read the DNS service state once per command, with a bounded read that kills a slow service manager. The failing-service line names min finalize-install only when --show prints the reinstall, and splits its facts into two sentences. finalize-install offers the reinstall on the daemon-timeout path too.
The replace line prints only when the probe's script copies this release's minzoned. A probe that waits on a daemon keeps the come-back note. install_test.sh covers both, on Linux and macOS.
|
Round 1 of 10 on a /revise note, pushed as
Verify Converted to a draft: something above needs a person before review. After an upgrade that ships a new minzoned, min finalize-install --show prints a script that copies the shipped minzoned over the installed copy. This is true when a daemon answers, when none runs, and when the daemon read times out. min ls and the session start name Minimal's failing DNS service. They name min finalize-install only when that command offers the reinstall. The installer names the replace only when the probe's script carries the copy. Notes from the agent: Revise round 1, the six items of the /revise note. (1) install.sh prints the replace line only when the probe's script quotes this release's minzoned (or Minimal.app on macOS) as its copy source. A probe with no script keeps the 'after your first min' line. install_test.sh covers both on Linux and darwin, plus a script that carries no copy. The fake min can now print $HOME/finalize.script. (2) The daemon-read timeout path and the no-port path both go through reinstall_or_waiting. (3) New AnswererStep::reinstall_offered: SourceVerified over a stale or failing service, with answerer_install Some. finalize-install, min ls and the session start all use it. The line names min finalize-install only when it is true. Otherwise it states the situation and stops. (4) answerer_job_blocking spawns the child, polls it to a 1 s deadline, and kills and reaps it on timeout. min ls reads the state once per command into a new HostInstall.dns_service field. The formatters read that field, so tests.rs formatter calls with HostInstall::default() make no service-manager call. The session start (vm_host_answerer_start_line, called from create.rs, which is outside the layers) reads the state once, on its own thread and runtime, and only for the service port held with no channel. read_answerer_step_with_job lets that read reuse the job state. (5) The finalize-install test now expects the reinstall unconditionally and asserts the install -m copy line, the pinned-hash check and the mv. Like the existing resolver …[truncated] |
Defect
Fixes #3474
crates/minimal/src/resolver.rscrates/minimal/src/cmd/finalize_install.rscrates/minimal/src/cmd/list.rscrates/minimal/src/cmd/boxes/vm_host.rsscripts/install.shscripts/install_test.shTask marker
Proof
After an upgrade that ships a new minzoned, the installed DNS service reads as stale (its SHA-256 differs from the shipped minzoned) or failing (its dev.gominimal.zone or minzoned.service job is loaded but not running). min finalize-install --show then lists the names item as missing, not waiting, and --show --script prints a script that copies the pinned shipped minzoned over the installed copy. When that job holds 127.0.0.1:7656 and is not running, min ls and the session start print: "box names are not answered: Minimal's DNS service holds 127.0.0.1:7656 (UDP) but is not running. Run
min finalize-installto reinstall it." The installer offers min finalize-install when the shipped minzoned differs from the installed copy.Notes from the agent: New AnswererStep states: CopyDiffers and NotRunning. AnswererFacts gains installed_sha256, shipped_sha256 and job. The job state comes from
launchctl print system/dev.gominimal.zoneon macOS, or fromsystemctl show minzoned.serviceon Linux. The read has a 1 s bound and returns Unknown when it times out. An inactive, socket-activated systemd service claims nothing. finalize-install also offers the reinstall when no daemon reports a port at all and the installed service is stale or failing. It uses the service's fixed port 7656 for this. Without that, the installer probe, which runs with no daemon, never gets a script for a stale copy. The list.rs and vm_host.rs line goes through resolver::dns_service_line_on_this_host. That function runs the blocking job read only for a port held with no channel at 7656, so create.rs (outside the layers) needs no change. The new printed text is not fixed in the task: the failing-service DNS SERVICE line, the two finalize-install facts and the two installer lines. Review them. 'Runmin finalize-installto reinstall it' is true only when the copy source verifies. When it does not, finalize-install says why it leaves the DNS service out. Not verified on macOS: this box is Li…[truncated]Tests
cargo test -p minimal answerer_step_over_reinstalls_a_copy_that_differs_from_the_shipped_minzonedcargo test -p minimal answerer_step_over_reinstalls_a_job_that_keeps_exitingcargo test -p minimal vm_host_answerer_line_names_a_failing_dns_servicecargo test -p minimal finalize_install_show_offers_reinstall_for_a_failing_answererbash scripts/install_test.shVerify
min task run agent-verifyexited 100, so this PR is a draft.Base
The base branch moved while the coder worked; it was merged in before the tests ran.