fix(net): stop a silent origin from parking a command with no timeout and no Ctrl-C - #886
Merged
Conversation
… 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.
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.
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-Cflag during it. On a cask install that stall happens whiledb/malt.lockis 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
Notes for Reviewers
cli/install/local.zighas 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.