Fixes novox/hq issue 434 (a mesh-host test fails now and then under the whole suite's load).
What raced
The fault is in the engine, not the test. answer wrote its refusal (busy, and the other refusals before a line is asked) and closed the connection before reading the request. The client writes its request first and reads the answer after. When the client's write came after the engine's close, the write failed with broken pipe, cli.Ask returned an error, and the refusal already in the client's buffer was never read. The test discarded that error (a, _ :=), so it showed as an empty answer with Exit 0. A real mesh-cli caller would have seen "asking the node-engine: ... broken pipe" instead of busy.
How it was reproduced
The test binary under -race, -count=500 -cpu=1,2,4, with go test -race ./... running beside it and every CPU burnt by a shell loop: 47 of 1500 failed on main. A debug build that kept Ask's error showed every failure was write: broken pipe on the request.
What changes
answer reads the request (bounded by refusedWithin, 5 s, and never past readWithin) before writing any refusal; what it reads is never asked.
The busy test now fails on Ask's error instead of discarding it.
New TestARefusalWaitsForTheRequestItAnswers: a client connects and holds its line back; no answer may come before the line, and the line, once written, is answered busy. Ordered by the client's own write, not by timing. It fails 20 of 20 on main.
Run counts
Fixed, same load (suite beside it + CPU burn), -race -count=500 -cpu=1,2,4: 0 of 1500 failed (main: 47 of 1500).
go vet ./... clean; go test -race ./internal/meshcli/ -count=1 passes; the whole suite passed under -race beside the fixed run.
Not done here
The client in mesh-sdk (cli.AskWith) still gives up on a failed write without reading an answer that may be waiting. With this change the engine no longer closes before the request lands, except for a client that says nothing for 5 s. Reading the answer after a failed write in the SDK would close that last gap; it is a separate repository and change.
Fixes novox/hq issue 434 (a mesh-host test fails now and then under the whole suite's load).
## What raced
The fault is in the engine, not the test. `answer` wrote its refusal (busy, and the other refusals before a line is asked) and closed the connection **before** reading the request. The client writes its request first and reads the answer after. When the client's write came after the engine's close, the write failed with `broken pipe`, `cli.Ask` returned an error, and the refusal already in the client's buffer was never read. The test discarded that error (`a, _ :=`), so it showed as an empty answer with Exit 0. A real mesh-cli caller would have seen "asking the node-engine: ... broken pipe" instead of busy.
## How it was reproduced
The test binary under `-race`, `-count=500 -cpu=1,2,4`, with `go test -race ./...` running beside it and every CPU burnt by a shell loop: **47 of 1500 failed** on main. A debug build that kept Ask's error showed every failure was `write: broken pipe` on the request.
## What changes
- `answer` reads the request (bounded by `refusedWithin`, 5 s, and never past `readWithin`) before writing any refusal; what it reads is never asked.
- The busy test now fails on Ask's error instead of discarding it.
- New `TestARefusalWaitsForTheRequestItAnswers`: a client connects and holds its line back; no answer may come before the line, and the line, once written, is answered busy. Ordered by the client's own write, not by timing. It fails 20 of 20 on main.
## Run counts
- Fixed, same load (suite beside it + CPU burn), `-race -count=500 -cpu=1,2,4`: **0 of 1500 failed** (main: 47 of 1500).
- `go vet ./...` clean; `go test -race ./internal/meshcli/ -count=1` passes; the whole suite passed under -race beside the fixed run.
## Not done here
The client in mesh-sdk (`cli.AskWith`) still gives up on a failed write without reading an answer that may be waiting. With this change the engine no longer closes before the request lands, except for a client that says nothing for 5 s. Reading the answer after a failed write in the SDK would close that last gap; it is a separate repository and change.
mesh/merge-gate pass: builds mesh-host → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of 4 compose)
The engine answered busy and closed before the client's request had landed;
the client's write then broke and it never read the refusal waiting for it.
Under the whole suite's load this failed the busy test (novox/hq issue 434).
Deliverynovox/mesh-host@f9805b211346 — delivered since 2026-10-11T01:02:04Z
Delivery plan — builds mesh-host → ace, g14, novox, shanks; no bus step
tier 0: mesh-host
ace: receives mesh-host
g14: receives mesh-host
novox: receives mesh-host
shanks: receives mesh-host
Machines
mesh-host on ace: passed — healthy 3 times over 2m46s
mesh-delivery on novox: passed — healthy 3 times over 2m26s
mesh-delivery on the rest running it: sent
mesh-host on the rest running it: sent
Transitions
2026-10-11 00:47 (new) → proposed (announced): novox/mesh-host#80's head announced
2026-10-11 00:49 proposed → checked (checked): the verdict names this commit
2026-10-11 00:49 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
2026-10-11 00:57 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
2026-10-11 00:57 published → delivering (go): its walk started: let go by this owner in its group's order, by a person, or on the controller's own path — not a failed walk that carried a later commit for it, after which it waits for a walk of its own commit
2026-10-11 01:02 delivering → delivered (done): its walk is done, carrying its own commit: every machine of its deploy plan passed, or was left as its policy says
The commit's note under refs/notes/mesh-plan keeps every transition: git log --notes=mesh-plan.
<!-- mesh-delivery:view -->
**Delivery** `novox/mesh-host@f9805b211346` — **delivered** since 2026-10-11T01:02:04Z
**Delivery plan** — builds mesh-host → ace, g14, novox, shanks; no bus step
- tier 0: mesh-host
- ace: receives mesh-host
- g14: receives mesh-host
- novox: receives mesh-host
- shanks: receives mesh-host
**Machines**
- mesh-host on ace: passed — healthy 3 times over 2m46s
- mesh-delivery on novox: passed — healthy 3 times over 2m26s
- mesh-delivery on the rest running it: sent
- mesh-host on the rest running it: sent
**Transitions**
- 2026-10-11 00:47 (new) → proposed (announced): novox/mesh-host#80's head announced
- 2026-10-11 00:49 proposed → checked (checked): the verdict names this commit
- 2026-10-11 00:49 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
- 2026-10-11 00:57 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
- 2026-10-11 00:57 published → delivering (go): its walk started: let go by this owner in its group's order, by a person, or on the controller's own path — not a failed walk that carried a later commit for it, after which it waits for a walk of its own commit
- 2026-10-11 01:02 delivering → delivered (done): its walk is done, carrying its own commit: every machine of its deploy plan passed, or was left as its policy says
The commit's note under `refs/notes/mesh-plan` keeps every transition: `git log --notes=mesh-plan`.
mesh/merge-gate: PASS — every machine composes with the change as it did without (4 of 4 compose) (modules: mesh-host)
mesh/repo-check: PASS — its merge-check.sh passed
Delivery plan — builds mesh-host → ace, g14, novox, shanks; no bus step
tier 0: mesh-host
ace: receives mesh-host
g14: receives mesh-host
novox: receives mesh-host
shanks: receives mesh-host
read by no module's build: internal/meshcli/meshcli_test.go
Run by the build seat on shanks as build-1791678936309319203 (builds --log build-1791678936309319203).
--- the gate: mesh-host
mesh-host: ok
long-running resources without health: 0
files asking for a setting without saying whether it is trusted: 0
1 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here
judging 0 module(s) changed against 4 machine(s), as the snapshot of 2026-10-11T00:35:35Z says they run
composing every machine as the mesh is
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
composing every machine with the change
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose)
judged by controller development build against the facts of 2026-10-11T00:35:35Z
machines:
- a machine (f35): composes
- holds mesh-dns-resolver (idt): composes
- holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes
- a machine (yvbpsm): composes
a merge would rebuild 1 module(s) in 1 tier(s): mesh-host
notes:
- internal/meshcli/meshcli_test.go read by no module's build, and rebuild nothing (issue 280)
--- its merge-check.sh (go toolchain)
ok github.com/novox/mesh-host/cmd/mesh-bootstrap 1.027s
ok github.com/novox/mesh-host/cmd/mesh-host 5.472s
ok github.com/novox/mesh-host/examples 1.018s
ok github.com/novox/mesh-host/internal/accounts 1.625s
ok github.com/novox/mesh-host/internal/apply 4.799s
ok github.com/novox/mesh-host/internal/bootstrap 1.669s
ok github.com/novox/mesh-host/internal/bundle 1.051s
ok github.com/novox/mesh-host/internal/declaration 1.110s
ok github.com/novox/mesh-host/internal/firewall 1.920s
ok github.com/novox/mesh-host/internal/identity 1.143s
ok github.com/novox/mesh-host/internal/image 1.048s
ok github.com/novox/mesh-host/internal/inventory 1.038s
ok github.com/novox/mesh-host/internal/link 10.468s
ok github.com/novox/mesh-host/internal/liveness 2.141s
ok github.com/novox/mesh-host/internal/meshcli 1.583s
ok github.com/novox/mesh-host/internal/network 1.077s
ok github.com/novox/mesh-host/internal/outward 1.055s
ok github.com/novox/mesh-host/internal/profile 1.544s
ok github.com/novox/mesh-host/internal/reachable 1.053s
ok github.com/novox/mesh-host/internal/store 1.246s
ok github.com/novox/mesh-host/internal/system 1.062s
ok github.com/novox/mesh-host/internal/tunnel 1.065s
ok github.com/novox/mesh-host/internal/units 1.045s
ok github.com/novox/mesh-host/internal/upgrade 1.189s
ok github.com/novox/mesh-host/internal/witness 4.838s
ok github.com/novox/mesh-host/packaging 1.013s
? github.com/novox/mesh-host/rootsearch [no test files]
ok github.com/novox/mesh-host/validate 1.008s
**Merge check** at `70cb6136`
- `mesh/merge-gate`: **PASS** — every machine composes with the change as it did without (4 of 4 compose) (modules: mesh-host)
- `mesh/repo-check`: **PASS** — its merge-check.sh passed
**Delivery plan** — builds mesh-host → ace, g14, novox, shanks; no bus step
- tier 0: mesh-host
- ace: receives mesh-host
- g14: receives mesh-host
- novox: receives mesh-host
- shanks: receives mesh-host
- read by no module's build: internal/meshcli/meshcli_test.go
Run by the build seat on shanks as `build-1791678936309319203` (`builds --log build-1791678936309319203`).
```
--- the gate: mesh-host
mesh-host: ok
long-running resources without health: 0
files asking for a setting without saying whether it is trusted: 0
1 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here
judging 0 module(s) changed against 4 machine(s), as the snapshot of 2026-10-11T00:35:35Z says they run
composing every machine as the mesh is
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
composing every machine with the change
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose)
judged by controller development build against the facts of 2026-10-11T00:35:35Z
machines:
- a machine (f35): composes
- holds mesh-dns-resolver (idt): composes
- holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes
- a machine (yvbpsm): composes
a merge would rebuild 1 module(s) in 1 tier(s): mesh-host
notes:
- internal/meshcli/meshcli_test.go read by no module's build, and rebuild nothing (issue 280)
--- its merge-check.sh (go toolchain)
ok github.com/novox/mesh-host/cmd/mesh-bootstrap 1.027s
ok github.com/novox/mesh-host/cmd/mesh-host 5.472s
ok github.com/novox/mesh-host/examples 1.018s
ok github.com/novox/mesh-host/internal/accounts 1.625s
ok github.com/novox/mesh-host/internal/apply 4.799s
ok github.com/novox/mesh-host/internal/bootstrap 1.669s
ok github.com/novox/mesh-host/internal/bundle 1.051s
ok github.com/novox/mesh-host/internal/declaration 1.110s
ok github.com/novox/mesh-host/internal/firewall 1.920s
ok github.com/novox/mesh-host/internal/identity 1.143s
ok github.com/novox/mesh-host/internal/image 1.048s
ok github.com/novox/mesh-host/internal/inventory 1.038s
ok github.com/novox/mesh-host/internal/link 10.468s
ok github.com/novox/mesh-host/internal/liveness 2.141s
ok github.com/novox/mesh-host/internal/meshcli 1.583s
ok github.com/novox/mesh-host/internal/network 1.077s
ok github.com/novox/mesh-host/internal/outward 1.055s
ok github.com/novox/mesh-host/internal/profile 1.544s
ok github.com/novox/mesh-host/internal/reachable 1.053s
ok github.com/novox/mesh-host/internal/store 1.246s
ok github.com/novox/mesh-host/internal/system 1.062s
ok github.com/novox/mesh-host/internal/tunnel 1.065s
ok github.com/novox/mesh-host/internal/units 1.045s
ok github.com/novox/mesh-host/internal/upgrade 1.189s
ok github.com/novox/mesh-host/internal/witness 4.838s
ok github.com/novox/mesh-host/packaging 1.013s
? github.com/novox/mesh-host/rootsearch [no test files]
ok github.com/novox/mesh-host/validate 1.008s
```
mesh/merge-gate pass: builds mesh-host → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of 4 compose)
A refusal waiting for its request parsed it into a 64 KiB reader for up to 5 s,
on a socket every account may open. It now drains at most 4 KiB through a small
buffer for at most 1 s and never past the accept-time deadline, only 32 wait at
once, and an unknown account is refused before it takes a slot. The busy tests
wait for the first line with a timeout and say what came of it (novox/hq issue 434).
mesh/merge-gate: PASS — every machine composes with the change as it did without (4 of 4 compose) (modules: mesh-host)
mesh/repo-check: PASS — its merge-check.sh passed
Delivery plan — builds mesh-host → ace, g14, novox, shanks; no bus step
tier 0: mesh-host
ace: receives mesh-host
g14: receives mesh-host
novox: receives mesh-host
shanks: receives mesh-host
read by no module's build: internal/meshcli/meshcli_test.go
Run by the build seat on shanks as build-1791679635860304676 (builds --log build-1791679635860304676).
--- the gate: mesh-host
mesh-host: ok
long-running resources without health: 0
files asking for a setting without saying whether it is trusted: 0
1 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here
judging 0 module(s) changed against 4 machine(s), as the snapshot of 2026-10-11T00:44:35Z says they run
composing every machine as the mesh is
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
composing every machine with the change
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose)
judged by controller development build against the facts of 2026-10-11T00:44:35Z
machines:
- a machine (f35): composes
- holds mesh-dns-resolver (idt): composes
- holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes
- a machine (yvbpsm): composes
a merge would rebuild 1 module(s) in 1 tier(s): mesh-host
notes:
- internal/meshcli/meshcli_test.go read by no module's build, and rebuild nothing (issue 280)
--- its merge-check.sh (go toolchain)
ok github.com/novox/mesh-host/cmd/mesh-bootstrap 1.014s
ok github.com/novox/mesh-host/cmd/mesh-host 5.540s
ok github.com/novox/mesh-host/examples 1.062s
ok github.com/novox/mesh-host/internal/accounts 1.619s
ok github.com/novox/mesh-host/internal/apply 4.754s
ok github.com/novox/mesh-host/internal/bootstrap 1.657s
ok github.com/novox/mesh-host/internal/bundle 1.061s
ok github.com/novox/mesh-host/internal/declaration 1.099s
ok github.com/novox/mesh-host/internal/firewall 1.918s
ok github.com/novox/mesh-host/internal/identity 1.145s
ok github.com/novox/mesh-host/internal/image 1.059s
ok github.com/novox/mesh-host/internal/inventory 1.058s
ok github.com/novox/mesh-host/internal/link 10.505s
ok github.com/novox/mesh-host/internal/liveness 2.146s
ok github.com/novox/mesh-host/internal/meshcli 1.597s
ok github.com/novox/mesh-host/internal/network 1.079s
ok github.com/novox/mesh-host/internal/outward 1.064s
ok github.com/novox/mesh-host/internal/profile 1.548s
ok github.com/novox/mesh-host/internal/reachable 1.063s
ok github.com/novox/mesh-host/internal/store 1.247s
ok github.com/novox/mesh-host/internal/system 1.057s
ok github.com/novox/mesh-host/internal/tunnel 1.062s
ok github.com/novox/mesh-host/internal/units 1.062s
ok github.com/novox/mesh-host/internal/upgrade 1.197s
ok github.com/novox/mesh-host/internal/witness 4.587s
ok github.com/novox/mesh-host/packaging 1.011s
? github.com/novox/mesh-host/rootsearch [no test files]
ok github.com/novox/mesh-host/validate 1.009s
**Merge check** at `f9805b21`
- `mesh/merge-gate`: **PASS** — every machine composes with the change as it did without (4 of 4 compose) (modules: mesh-host)
- `mesh/repo-check`: **PASS** — its merge-check.sh passed
**Delivery plan** — builds mesh-host → ace, g14, novox, shanks; no bus step
- tier 0: mesh-host
- ace: receives mesh-host
- g14: receives mesh-host
- novox: receives mesh-host
- shanks: receives mesh-host
- read by no module's build: internal/meshcli/meshcli_test.go
Run by the build seat on shanks as `build-1791679635860304676` (`builds --log build-1791679635860304676`).
```
--- the gate: mesh-host
mesh-host: ok
long-running resources without health: 0
files asking for a setting without saying whether it is trusted: 0
1 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here
judging 0 module(s) changed against 4 machine(s), as the snapshot of 2026-10-11T00:44:35Z says they run
composing every machine as the mesh is
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
composing every machine with the change
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose)
judged by controller development build against the facts of 2026-10-11T00:44:35Z
machines:
- a machine (f35): composes
- holds mesh-dns-resolver (idt): composes
- holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes
- a machine (yvbpsm): composes
a merge would rebuild 1 module(s) in 1 tier(s): mesh-host
notes:
- internal/meshcli/meshcli_test.go read by no module's build, and rebuild nothing (issue 280)
--- its merge-check.sh (go toolchain)
ok github.com/novox/mesh-host/cmd/mesh-bootstrap 1.014s
ok github.com/novox/mesh-host/cmd/mesh-host 5.540s
ok github.com/novox/mesh-host/examples 1.062s
ok github.com/novox/mesh-host/internal/accounts 1.619s
ok github.com/novox/mesh-host/internal/apply 4.754s
ok github.com/novox/mesh-host/internal/bootstrap 1.657s
ok github.com/novox/mesh-host/internal/bundle 1.061s
ok github.com/novox/mesh-host/internal/declaration 1.099s
ok github.com/novox/mesh-host/internal/firewall 1.918s
ok github.com/novox/mesh-host/internal/identity 1.145s
ok github.com/novox/mesh-host/internal/image 1.059s
ok github.com/novox/mesh-host/internal/inventory 1.058s
ok github.com/novox/mesh-host/internal/link 10.505s
ok github.com/novox/mesh-host/internal/liveness 2.146s
ok github.com/novox/mesh-host/internal/meshcli 1.597s
ok github.com/novox/mesh-host/internal/network 1.079s
ok github.com/novox/mesh-host/internal/outward 1.064s
ok github.com/novox/mesh-host/internal/profile 1.548s
ok github.com/novox/mesh-host/internal/reachable 1.063s
ok github.com/novox/mesh-host/internal/store 1.247s
ok github.com/novox/mesh-host/internal/system 1.057s
ok github.com/novox/mesh-host/internal/tunnel 1.062s
ok github.com/novox/mesh-host/internal/units 1.062s
ok github.com/novox/mesh-host/internal/upgrade 1.197s
ok github.com/novox/mesh-host/internal/witness 4.587s
ok github.com/novox/mesh-host/packaging 1.011s
? github.com/novox/mesh-host/rootsearch [no test files]
ok github.com/novox/mesh-host/validate 1.009s
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes novox/hq issue 434 (a mesh-host test fails now and then under the whole suite's load).
What raced
The fault is in the engine, not the test.
answerwrote its refusal (busy, and the other refusals before a line is asked) and closed the connection before reading the request. The client writes its request first and reads the answer after. When the client's write came after the engine's close, the write failed withbroken pipe,cli.Askreturned an error, and the refusal already in the client's buffer was never read. The test discarded that error (a, _ :=), so it showed as an empty answer with Exit 0. A real mesh-cli caller would have seen "asking the node-engine: ... broken pipe" instead of busy.How it was reproduced
The test binary under
-race,-count=500 -cpu=1,2,4, withgo test -race ./...running beside it and every CPU burnt by a shell loop: 47 of 1500 failed on main. A debug build that kept Ask's error showed every failure waswrite: broken pipeon the request.What changes
answerreads the request (bounded byrefusedWithin, 5 s, and never pastreadWithin) before writing any refusal; what it reads is never asked.TestARefusalWaitsForTheRequestItAnswers: a client connects and holds its line back; no answer may come before the line, and the line, once written, is answered busy. Ordered by the client's own write, not by timing. It fails 20 of 20 on main.Run counts
-race -count=500 -cpu=1,2,4: 0 of 1500 failed (main: 47 of 1500).go vet ./...clean;go test -race ./internal/meshcli/ -count=1passes; the whole suite passed under -race beside the fixed run.Not done here
The client in mesh-sdk (
cli.AskWith) still gives up on a failed write without reading an answer that may be waiting. With this change the engine no longer closes before the request lands, except for a client that says nothing for 5 s. Reading the answer after a failed write in the SDK would close that last gap; it is a separate repository and change.Delivery
novox/mesh-host@f9805b211346— delivered since 2026-10-11T01:02:04ZDelivery plan — builds mesh-host → ace, g14, novox, shanks; no bus step
Machines
Transitions
The commit's note under
refs/notes/mesh-plankeeps every transition:git log --notes=mesh-plan.Merge check at
70cb6136mesh/merge-gate: PASS — every machine composes with the change as it did without (4 of 4 compose) (modules: mesh-host)mesh/repo-check: PASS — its merge-check.sh passedDelivery plan — builds mesh-host → ace, g14, novox, shanks; no bus step
Run by the build seat on shanks as
build-1791678936309319203(builds --log build-1791678936309319203).Merge check at
f9805b21mesh/merge-gate: PASS — every machine composes with the change as it did without (4 of 4 compose) (modules: mesh-host)mesh/repo-check: PASS — its merge-check.sh passedDelivery plan — builds mesh-host → ace, g14, novox, shanks; no bus step
Run by the build seat on shanks as
build-1791679635860304676(builds --log build-1791679635860304676).