What changed
The HTTP/2 health check is the only probe of a connection whose path has
died silently, so a turn in flight on such a connection waits for the
next one: with PingAfter at 20s a first try read EOF came ~20.5s after it
was written (Antigravity through a local proxy whose tunnel a NAT or a
relay had dropped, yetone/magpie#4936), and magpie's own retry served at
once on a new connection. PingAfter is 10s now: finding a dead path costs
at most half of what it did, and the margin a body under uploadBytes
needs on a slow uplink — the budget PingAfter+PingWait, a ping queued
behind the body and answered only after its last byte (#3909) — still
covers 64KB at about 3KB/s.
Run
go test -tags nogui -count=1 ./internal/netproxy (a new test walks a turn
onto a connection whose path dies under it and watches it fail at the
health check, then a retry serve on a connection of its own; a second
locks the sizing)
go test -tags nogui -count=1 ./internal/... — TestMothX,
TestProxyCheckSaysAProxyPassedBy and TestHostToldTheGatewayAddress are
red alone on the parent commit too; TestCodexPoolSaysTheClientsVersion is
a known full-suite flake, green alone
go vet, gofmt, GOOS=linux GOARCH=amd64 go build, GOOS=windows
GOARCH=amd64 go build, go build on darwin.
Reviewed and ported: every line read against origin/main 1b0340fdb.
Bodies of uploadBytes (64KB) and over go over HTTP/1.1, so the
PingAfter+PingWait budget, 30s down to 20s, still covers what HTTP/2
carries at ~3.2KB/s. On mote: TestPingAfterSizesTheDeadPathDiscovery is
red with netproxy.go put back to 1b0340fdb ("PingAfter 20s; want 10s"),
green with it. TestRequestOnAHoledConnectionFailsAtThePing builds its own
transport with scaled timings, so it passes on the old code too: it
documents Go's HTTP/2 health check on a dead tunnel, not this value.
On mote at this tree: go test -tags nogui -count=1 -timeout 45m
./internal/gateway/ ./internal/netproxy/: ok (gateway 1025.9s, netproxy
5.3s); go vet -tags nogui of both packages for darwin, GOOS=linux and
GOOS=windows: clean; gofmt -l: clean.
Not tried: the reporter's Clash/Mihomo route to Antigravity. This halves
the stall on a dead pooled connection (~21.5s to ~11.5s); it doesn't stop
the first try landing on it.
Generated-by: GLM-5.3-Flash (ZCode)
Co-authored-by: ggbdpq <ggbdpq@gmail.com>