Skip to content

fix(net): stop a silent origin from parking a command with no timeout and no Ctrl-C - #886

Merged
indaco merged 2 commits into
mainfrom
fix/deadline-the-request-phase
Aug 21, 2026
Merged

fix(net): stop a silent origin from parking a command with no timeout and no Ctrl-C#886
indaco merged 2 commits into
mainfrom
fix/deadline-the-request-phase

Conversation

@indaco

@indaco indaco commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Description

A host that accepted the connection and then never sent a response head froze malt indefinitely - the per-request timeout only ever reached the body, so nothing bounded the phase before it and nothing sampled the Ctrl-C flag during it. On a cask install that stall happens while db/malt.lock is held, so one silent origin blocked every other malt invocation until the process was killed.

Each hop now has to answer within the same timeout every other read already gets, and Ctrl-C lands on the first press. What used to be an unbounded hang is now a bounded failure.

Related Issue

  • None

Notes for Reviewers

  • The budget is per hop rather than per walk. A hop that answers is evidence its peer is alive - the same thing the body's idle watchdog reads from byte progress - so a long redirect chain on a slow link is not failed for being long.
  • The tap-source download in cli/install/local.zig has no retry of its own, so a host slower than the budget now fails outright where it previously waited. The budget is deliberately the existing request timeout rather than a tighter figure of its own, which keeps that path clear of any origin that is merely slow.
  • A stall inside the TLS handshake is still uncovered; the watchdog needs a connection that does not exist that early. Called out in a comment, not chased here.

indaco added 2 commits August 21, 2026 17:55
… and no Ctrl-C

A host that accepted the connection and then never sent a response head froze
malt indefinitely: the per-request timeout only ever reached the body, so
nothing bounded the phase before it and nothing sampled the Ctrl-C flag during
it. On a cask install that stall happens while db/malt.lock is held, so one
silent origin blocked every other invocation until the process was killed.

Every hop must now answer within the same timeout the rest of a read already
gets, and Ctrl-C lands on the first press. The budget is per hop rather than
per walk because a hop that answers is evidence its peer is alive, so a long
redirect chain on a slow link is not failed for being long.

A silent peer is terminal inside net, so its own walks do not re-dial it. That
stops at net's edge: the ghcr path collapses the tag into a generic download
failure that the install loop still retries, which is left for its own change.
Judged through the integration test binary rather than the CLI: the assertion
is wall-clock-bound and MALT_API_DOMAIN is https-only, so the real binary
cannot be pointed at a cleartext loopback stall server.
@indaco
indaco merged commit e67e0dd into main Aug 21, 2026
3 checks passed
@indaco
indaco deleted the fix/deadline-the-request-phase branch August 21, 2026 16:02
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