Files
magpie/docs
yetoneandrecih 171475905f plugin: a reply's head that arrives with its completion is read, not dropped (#7017)
headRead checked the queue, found it empty, and then found the call's
result: a head the plugin queued between those two checks was lost, and
the reply was read as headless ("the vendor ended early"). The result
branch now takes a head queued meanwhile, as the c.done branch already
did. body.Read is not affected: it loops back to the queue after taking
the result.

From recih's branch (68bdf17e6), ported as its own commit.

Run: TestHostHeadArrivesWithCompletion passes on origin/main without
help (the window is narrow); with a 2ms sleep injected between the pop
and the result check it is red on origin/main ("completed reply's head
= {...}, the vendor ended early") and green with this change.
The full stack's run, on mote at e4506887c (this stack on origin/main 7300be4d0):
go test -timeout 45m ./...: 101 packages ok, 2 FAIL, both open issues
that fail the same at 7300be4d0 on mote, where an ssh session forwards
127.0.0.1:3425 to a real magpie: internal/cli's
TestHealthcheckFindsTheRunningGatewayWithoutMagpieAddr,
TestUpdateRestartsTheGatewayItFindsWithoutMagpieAddr and
TestUpdateFindsAMagpieThatWroteNoRecord (#6223), internal/gui's
TestLaneLimitRoutes (#5150). On mica: gofmt -l clean; go vet ./...,
GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go
build, GOOS=linux go build -tags nogui, GOOS=windows go build all ok.
go test -race -count=2 of the new and touched tests in internal/gateway,
gui, plugin, tui ok on mote.

Rebased since. At dc507aefd on mote: go vet (darwin, GOOS=linux
-tags nogui, windows) ok; go test of internal/cli, tui, plugin,
gateway, gui, claudebridge ok but for the same #6223 and #5150 reds.
At 939fe31b6 (on origin/main 78b6d47cc) on mote: gofmt -l clean, the
three vets ok, the stack's tests with TestClaude* and
TestCoreScriptBudget ok in all six packages. Pushed on b400566f9 after
a clean rebase; the commits between touch no Go file this stack does.

Co-authored-by: recih <240406+recih@users.noreply.github.com>
2026-11-18 23:06:38 +08:00
..