ggbdpq's patch (gua2100 on Discord), reviewed and landed with test
changes.
What changed
- netproxy.Watch gives the dispatch's per-request check for a moved
global proxy (#4523) to transports magpie keeps for itself. The sync
(davsync) uses http.DefaultTransport, so when one of its requests
finds the proxy moved, it now drops the idle connections itself.
Before this, only a DefaultClient request dropped them, and a backup
kept going through the old proxy's HTTP/2 connection.
- FetchIcon now closes the pool of the client that only the fetch used.
Nothing closed it before.
- Review changes: the davsync test restores settings.json afterwards,
and the icon test's wait for idle is bounded at 20s, not 2s, to leave
room under load.
Run at the pushed head (on mote, base 4d55a0a02)
- go test -race passes for netproxy, davsync and provider's touched
tests.
- go test -tags nogui -count=1 -timeout 45m ./... passes every package
except two reds already filed and not touched here:
- internal/cli TestEveryRouteHasACommandOrIsNamed (#4826, red on main
since e87140242);
- internal/gateway TestCodexPoolSaysTheClientsVersion (#4807, another
test's Codex identity, passes alone).
- gofmt -l is clean. go vet ./... passes for darwin, for GOOS=linux
(-tags nogui) and for GOOS=windows, and so do the linux and windows
builds.
Broken by hand
- With stall.go's move check off, TestGlobalSwitchDialsTheSyncThroughTheNewProxy
is red: "1 connections through A, 0 through B".
- With FetchIcon's CloseIdleConnections removed,
TestFetchIconLeavesNoIdleConnection is red: "the fetch's connection is
still idle".
- With Watch never reporting a move, TestGlobalSwitchDropsTheOldProxyConnections
and TestWatchSeesTheGlobalProxyMove are red.
Not tried: a real proxy switch with a real WebDAV/S3 target or icon
host, or Windows/Linux at run time (vet and build only).
Co-authored-by: yetone <yetoneful@gmail.com>
What changed: the stall watchdog saw a request as one whose body may
outlast the whole metadata limit only by method (GET, PUT), and gave every
other request a flat 30 s (#657's rule held for WebDAV and S3, whose
remaining requests move a few KB at most). GitHub's uploads ride a POST:
each blob POST hauls up to 16 MiB of file as about 21 MB of base64, and a
flat 30 s needs 550 KB/s to get one part through (#4576: on a slower line
the sync failed on the same POST at every attempt, automatic, at start and
manual, and never recovered -- the usage day file froze in the morning
while the machine kept working). A request hauling a big body (64 KiB or
more) now gets the same moving-aware budget as a PUT: the watchdog is put
back each time bytes move, and after the body is all handed over the
answer gets 60 s on top of as long as the write took. The metadata
requests (the GitHub tree, commit and ref POSTs and PATCH, WebDAV
PROPFIND/MKCOL/MOVE/DELETE -- kilobytes at most) keep their 30 s in all.
Run: TestGitHubSlowBlobUploadIsNotCutShort (a 272 KB base64 body through a
line at 320 KB/s, watchdogs shortened to 1 s/300 ms) fails on the old code
with "the server didn't answer in 300ms (POST)", the shape of #4576's
error, and passes now; TestGitHubSmallPostKeepsTheLimit pins the small
POSTs to the old limit either way. go test -tags nogui ./internal/davsync,
vet and builds for darwin, GOOS=linux and GOOS=windows pass. Not tried
against a real slow line to GitHub.
Generated-by: GLM-5.3-Flash (ZCode)