Repository navigation
fix(minimal): finalize-install replaces a stale or failing installed minzoned, and min ls names - #3481
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] |
|
Reviewed: 2 findings, none blocking at Address the comments on the diff. Clobber: none seen. |
| # answerer_copy_differs — whether this run shipped a `minzoned` whose bytes | ||
| # differ from the root-owned copy `min finalize-install` installed: the | ||
| # DNS service then runs the old program until the step runs again. False | ||
| # when either file is missing or unreadable. The root is overridable for | ||
| # install_test.sh. Sets $_ac_source to what the step's script copies from: | ||
| # the shipped program on Linux, the app bundle around it on macOS. |
There was a problem hiding this comment.
LOW · correctness · confidence 0.80 · in answerer_copy_differs
The new answerer_copy_differs function sits between the long doc comment of offer_finalize_install and that function. The comment now reads as if it documents answerer_copy_differs, and offer_finalize_install has no comment. Move the new function and its comment above the offer_finalize_install comment block.
What the reviewer checked
install.sh: the block ending 'bare only once $bindir is on PATH' is followed directly by '# answerer_copy_differs —' and then 'offer_finalize_install() {' after the new function.
Hand this to an agent
Act on a code-review finding.
File: scripts/install.sh
Lines: 1686-1691
Category: correctness
Severity: low (reviewer confidence 0.80)
Finding:
The new answerer_copy_differs function sits between the long doc comment of offer_finalize_install and that function. The comment now reads as if it documents answerer_copy_differs, and offer_finalize_install has no comment. Move the new function and its comment above the offer_finalize_install comment block.
First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.
👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.
| ZoneAnswererStatus::PortHeldNoChannel { port } | ||
| if service.job == AnswererJob::NotRunning | ||
| && port == minvmd::net::answerer::DEFAULT_ANSWERER_PORT => | ||
| { | ||
| Some(failing_dns_service_line(port, service.reinstall_offered)) | ||
| } |
There was a problem hiding this comment.
LOW · correctness · confidence 0.50 · in vm_host_answerer_line_beside
vm_host_answerer_line_beside prints that Minimal's DNS service holds the port when the port is held with no channel and the job is NotRunning. The code never checks who holds the port. A systemd unit can be failed because another program holds the port. The line then blames the wrong holder. The line must state only what is proven, or the code must confirm the holder.
What the reviewer checked
ZoneAnswererStatus::PortHeldNoChannel { port } if service.job == AnswererJob::NotRunning && port == DEFAULT_ANSWERER_PORT => failing_dns_service_line(...)
Hand this to an agent
Act on a code-review finding.
File: crates/minimal/src/resolver.rs
Lines: 5109-5114
Category: correctness
Severity: low (reviewer confidence 0.50)
Finding:
vm_host_answerer_line_beside prints that Minimal's DNS service holds the port when the port is held with no channel and the job is NotRunning. The code never checks who holds the port. A systemd unit can be failed because another program holds the port. The line then blames the wrong holder. The line must state only what is proven, or the code must confirm the holder.
First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.
👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.
There was a problem hiding this comment.
Approved at 4f0583c. Round 1 addresses all six points of the /revise: min finalize-install is named only where it offers the reinstall, the stale check runs on the no-daemon and timeout paths, the service-state read is bounded and read once per command, and the replace-script test is unconditional.
…ed-version-ha Resolves the conflict in crates/minimal/src/resolver.rs with #3481 (finalize-install replaces a stale or failing minzoned). Both changes are kept: AnswererFacts carries the log-cap facts and the SHA-256/job facts, read_answerer_step_with_job reads both, and answerer_step_over runs the log and log-cap custody checks before the copy-differs and not-running states.
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.