carlos / platform Public

edge: close the demo API connection after an early answer (#1248)

The demo API alias enables full duplex and kept the connection open. When
the console answered an HTTP/1 request before its body had all arrived,
the proxy's transport could still be reading that body as the handler
returned. net/http then panicked reading the next request ("invalid
concurrent Body.Read call"), and after an unfinished chunked upload the
next request on the connection was answered 400.

An answer that beats the body now sends Connection: close, and the handler
discards what is left of the body for at most exitLingerBound before it
returns, using the same watchBody and finishEarlyAnswer the other early
answer paths use. An upload read to its end keeps its connection, and
HTTP/2 is unchanged.

The reproducer drives real connections through the local and backhaul
paths. It failed on the old code and passes 20 runs under -race.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 31210ccba1a758f040304a6b4a72a208a28a12b2 parent cef0180
4 files changed, +485 −2
  • docs/superpowers/notes/census-proposal-small-fixes-1246-1248.md +1 −1
  • internal/edge/demo_api.go +15 −0
  • internal/edge/demo_api_duplex_test.go +467 −0
  • internal/provision/testdata/plan14-root-reads-small-fixes-1246-1248.tsv +2 −1

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/census-proposal-small-fixes-1246-1248.md b/docs/superpowers/notes/census-proposal-small-fixes-1246-1248.md
index 1089067c6..27c73de59 100644
--- a/docs/superpowers/notes/census-proposal-small-fixes-1246-1248.md
+++ b/docs/superpowers/notes/census-proposal-small-fixes-1246-1248.md
@@ -6,7 +6,7 @@ Ruling `census-ruling-small-fixes-1246-1248`. The independent reviewer approves
|---|---|---|---|
| `internal/host/replicaplacement.go` `replicaPlacementWorker.run` | body | unchanged (6) | Logs the retire, acquire and publish failures it used to drop, at most once per backoff step, outside the worker lock. The retry decision, backoff arithmetic, deadlines and read sites are unchanged (6); no read added. |
-Envelopes re-pinned: `internal/host`.
+Envelopes re-pinned: `internal/edge`, `internal/host`.
Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
diff --git a/internal/edge/demo_api.go b/internal/edge/demo_api.go
index 222d6b581..e5fca43d5 100644
--- a/internal/edge/demo_api.go
+++ b/internal/edge/demo_api.go
@@ -120,6 +120,7 @@ func (e *Edge) serveDemoAPIAlias(w http.ResponseWriter, r *http.Request, host st
return false
}
dw := &demoAPIResponseWriter{ResponseWriter: w, header: make(http.Header)}
+ defer func() { finishEarlyAnswer(w, dw.body) }()
defer dw.finish()
if !allowed {
dw.WriteHeader(http.StatusNotFound)
@@ -130,6 +131,14 @@ func (e *Edge) serveDemoAPIAlias(w http.ResponseWriter, r *http.Request, host st
// refusal, so a client waiting for the response can stall both edges.
// HTTP/2 already permits concurrent reads and writes.
_ = http.NewResponseController(w).EnableFullDuplex()
+ // Full duplex lets the proxy's transport still be reading the body when
+ // the handler returns. If net/http then reads the next request from this
+ // connection it panics, and an unfinished chunked body is misread as a
+ // request (#1248). So an HTTP/1 answer that beats the body closes the
+ // connection (demoAPIResponseWriter.WriteHeader, finishEarlyAnswer).
+ if r.ProtoMajor == 1 {
+ r, dw.body = watchBody(r)
+ }
_, door := doorCallerFrom(r.Context())
if door || hopDoorFrom(r.Context()) || fromTunnel(r.Context()) || hopPresent && !hopped {
demoAPIUnavailable(dw)
@@ -272,6 +281,8 @@ type demoAPIResponseWriter struct {
header http.Header
committed bool
trailers []string
+ // body is the HTTP/1 request body still being relayed, nil otherwise.
+ body *streamedBody
}
func (w *demoAPIResponseWriter) Header() http.Header { return w.header }
@@ -291,6 +302,10 @@ func (w *demoAPIResponseWriter) WriteHeader(code int) {
}
if code >= 200 {
w.committed = true
+ if w.body != nil && !w.body.done.Load() {
+ dst.Set("Connection", "close")
+ w.body.closing.Store(true)
+ }
for _, v := range h.Values("Trailer") {
for _, n := range strings.Split(v, ",") {
w.trailers = append(w.trailers, http.CanonicalHeaderKey(strings.TrimSpace(n)))
diff --git a/internal/edge/demo_api_duplex_test.go b/internal/edge/demo_api_duplex_test.go
new file mode 100644
index 000000000..b2aad974e
--- /dev/null
+++ b/internal/edge/demo_api_duplex_test.go
@@ -0,0 +1,467 @@
+package edge
+
+import (
+ "bufio"
+ "crypto/tls"
+ "errors"
+ "fmt"
+ "io"
+ "log"
+ "net"
+ "net/http"
+ "net/http/httptest"
+ "slices"
+ "strings"
+ "sync"
+ "sync/atomic"
+ "syscall"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// #1248: the demo API alias turns on full duplex and leaves the connection
+// open for another request. These tests answer a request while its body is
+// still arriving, finish the body, and send a second request on the same
+// connection. Run them with -race.
+
+// How the console answers the upload before it has read it.
+type demoDuplexConsole int
+
+const (
+ // Answers with Connection: close and returns, with the body unread: how
+ // a plain net/http handler refuses an upload without waiting for it.
+ demoConsoleAnswersAndReturns demoDuplexConsole = iota
+ // Answers, then reads the rest of the body.
+ demoConsoleAnswersThenReads
+ // Answers whole on the raw connection, and holds it open unread.
+ demoConsoleAnswersAndHolds
+ // Answers with Connection: close and closes.
+ demoConsoleAnswersAndCloses
+)
+
+func (c demoDuplexConsole) String() string {
+ return [...]string{"answers-and-returns", "answers-then-reads", "answers-and-holds", "answers-and-closes"}[c]
+}
+
+// A request hidden in the tail of the upload: it is body, and must never be
+// parsed as a request of its own.
+const demoDuplexSmuggled = "/api/demo/jobs/smuggled"
+
+const demoDuplexRefusal = "refused"
+
+type demoDuplexScene struct {
+ console atomic.Int32
+ done atomic.Pointer[chan struct{}]
+ mu sync.Mutex
+ seen []string
+ held []net.Conn
+}
+
+func (s *demoDuplexScene) paths() []string {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ return slices.Clone(s.seen)
+}
+
+func (s *demoDuplexScene) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+ s.mu.Lock()
+ s.seen = append(s.seen, r.URL.Path)
+ s.mu.Unlock()
+ if r.Method != http.MethodPost {
+ io.WriteString(w, "second")
+ return
+ }
+ mode := demoDuplexConsole(s.console.Load())
+ if mode == demoConsoleAnswersAndHolds || mode == demoConsoleAnswersAndCloses {
+ conn, _, err := http.NewResponseController(w).Hijack()
+ if err != nil {
+ panic(err)
+ }
+ head := "HTTP/1.1 403 Forbidden\r\nContent-Length: " + fmt.Sprint(len(demoDuplexRefusal)) + "\r\n"
+ if mode == demoConsoleAnswersAndCloses {
+ io.WriteString(conn, head+"Connection: close\r\n\r\n"+demoDuplexRefusal)
+ conn.Close()
+ return
+ }
+ io.WriteString(conn, head+"\r\n"+demoDuplexRefusal)
+ s.mu.Lock()
+ s.held = append(s.held, conn)
+ s.mu.Unlock()
+ return
+ }
+ rc := http.NewResponseController(w)
+ if mode == demoConsoleAnswersAndReturns {
+ w.Header().Set("Connection", "close")
+ w.WriteHeader(http.StatusForbidden)
+ io.WriteString(w, demoDuplexRefusal)
+ return
+ }
+ if err := rc.EnableFullDuplex(); err != nil {
+ panic(err)
+ }
+ // A declared length ends the answer for the client while this handler
+ // is still reading the upload.
+ w.Header().Set("Content-Length", fmt.Sprint(len(demoDuplexRefusal)))
+ w.WriteHeader(http.StatusForbidden)
+ io.WriteString(w, demoDuplexRefusal)
+ rc.Flush()
+ if mode == demoConsoleAnswersThenReads {
+ io.Copy(io.Discard, r.Body)
+ }
+}
+
+func (s *demoDuplexScene) closeHeld() {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ for _, c := range s.held {
+ c.Close()
+ }
+ s.held = nil
+}
+
+// When the client sends the rest of the upload.
+type demoDuplexTiming int
+
+const (
+ // As soon as it has read the answer.
+ demoSendsAfterAnswer demoDuplexTiming = iota
+ // Once the edge's handler has returned.
+ demoSendsAfterHandler
+ // As soon as it has read the answer, with the second request in the same
+ // write.
+ demoSendsPipelined
+ // Before any answer: the whole upload and the second request in one
+ // write, so the transport is still copying the body as the handler ends.
+ demoSendsWhole
+)
+
+func (d demoDuplexTiming) String() string {
+ return [...]string{"after-answer", "after-handler", "pipelined", "whole"}[d]
+}
+
+type demoDuplexCase struct {
+ console demoDuplexConsole
+ timing demoDuplexTiming
+ chunked bool
+ expect bool
+ // padding is added to the upload's tail, past net/http's post-handler
+ // read limit when it is large.
+ padding int
+}
+
+func (c demoDuplexCase) name() string {
+ name := c.console.String() + "/" + c.timing.String()
+ if c.chunked {
+ name += "/chunked"
+ }
+ if c.expect {
+ name += "/expect-continue"
+ }
+ if c.padding > 0 {
+ name += "/large"
+ }
+ return name
+}
+
+// demoDuplexGone is whether err is the far side having closed the connection.
+func demoDuplexGone(err error) bool {
+ return errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) || errors.Is(err, net.ErrClosed) ||
+ errors.Is(err, syscall.ECONNRESET) || errors.Is(err, syscall.EPIPE)
+}
+
+// runDemoDuplexCase drives one connection and reports whether the edge
+// reused it ("reused") or closed it ("closed"). Anything else fails the test:
+// a wrong answer, a stall, or the upload's tail parsed as a request.
+func runDemoDuplexCase(t *testing.T, conn net.Conn, s *demoDuplexScene, c demoDuplexCase, handlerDone <-chan struct{}) string {
+ t.Helper()
+ if err := conn.SetDeadline(time.Now().Add(8 * time.Second)); err != nil {
+ t.Fatal(err)
+ }
+ first := "first-part-"
+ rest := strings.Repeat("x", c.padding) + "\r\n\r\nGET " + demoDuplexSmuggled + " HTTP/1.1\r\nHost: " + demoAPISite + "\r\n\r\n"
+ head := "POST /api/demo/apps HTTP/1.1\r\nHost: " + demoAPISite + "\r\nContent-Type: application/json\r\n"
+ if c.expect {
+ head += "Expect: 100-continue\r\n"
+ }
+ var opening, closing string
+ if c.chunked {
+ opening = head + "Transfer-Encoding: chunked\r\n\r\n" + fmt.Sprintf("%x\r\n%s\r\n", len(first), first)
+ closing = fmt.Sprintf("%x\r\n%s\r\n0\r\n\r\n", len(rest), rest)
+ } else {
+ opening = head + fmt.Sprintf("Content-Length: %d\r\n\r\n", len(first)+len(rest)) + first
+ closing = rest
+ }
+ second := "GET /api/demo/jobs/second HTTP/1.1\r\nHost: " + demoAPISite + "\r\n\r\n"
+ if c.timing == demoSendsWhole {
+ opening += closing + second
+ }
+
+ if _, err := io.WriteString(conn, opening); err != nil {
+ t.Fatalf("sending the start of the upload: %v", err)
+ }
+ br := bufio.NewReader(conn)
+ resp, err := http.ReadResponse(br, &http.Request{Method: http.MethodPost})
+ for err == nil && resp.StatusCode < 200 {
+ resp, err = http.ReadResponse(br, &http.Request{Method: http.MethodPost})
+ }
+ if err != nil {
+ t.Fatalf("the early answer: %v", err)
+ }
+ body, err := io.ReadAll(resp.Body)
+ if err != nil || resp.StatusCode != http.StatusForbidden || string(body) != demoDuplexRefusal {
+ t.Fatalf("the early answer: %d %q, %v", resp.StatusCode, body, err)
+ }
+ // Sent before the upload ended, the answer must end the connection.
+ if c.timing != demoSendsWhole && !resp.Close {
+ t.Fatal("an answer that beat the upload left the connection open")
+ }
+
+ if c.timing == demoSendsAfterHandler {
+ select {
+ case <-handlerDone:
+ case <-time.After(15 * time.Second):
+ t.Fatal("the edge's handler did not return after the answer")
+ }
+ }
+ var wrote error
+ if c.timing == demoSendsWhole {
+ // Everything is on its way already.
+ } else if c.timing == demoSendsPipelined {
+ _, wrote = io.WriteString(conn, closing+second)
+ } else if _, wrote = io.WriteString(conn, closing); wrote == nil {
+ _, wrote = io.WriteString(conn, second)
+ }
+ if wrote != nil {
+ if !demoDuplexGone(wrote) {
+ t.Fatalf("sending the rest: %v", wrote)
+ }
+ return "closed"
+ }
+ next, err := http.ReadResponse(br, &http.Request{Method: http.MethodGet})
+ if err != nil {
+ if !demoDuplexGone(err) {
+ t.Fatalf("the second answer: %v", err)
+ }
+ return "closed"
+ }
+ got, err := io.ReadAll(next.Body)
+ if err != nil || next.StatusCode != http.StatusOK || string(got) != "second" {
+ t.Fatalf("the second request was answered %d %q, %v", next.StatusCode, got, err)
+ }
+ return "reused"
+}
+
+func checkDemoDuplexPaths(t *testing.T, s *demoDuplexScene, outcome string) {
+ t.Helper()
+ paths := s.paths()
+ if slices.Contains(paths, demoDuplexSmuggled) {
+ t.Fatalf("the upload's tail reached the console as a request: %v", paths)
+ }
+ if outcome == "reused" && !slices.Contains(paths, "/api/demo/jobs/second") {
+ t.Fatalf("a second answer with no second request at the console: %v", paths)
+ }
+}
+
+func checkDemoDuplexLog(t *testing.T, who string, logs *lockedBuffer) {
+ t.Helper()
+ if text := logs.String(); strings.Contains(text, "panic") {
+ t.Fatalf("net/http panicked in %s:\n%s", who, text)
+ }
+}
+
+func demoDuplexCases() []demoDuplexCase {
+ var cases []demoDuplexCase
+ for _, console := range []demoDuplexConsole{demoConsoleAnswersAndReturns, demoConsoleAnswersThenReads, demoConsoleAnswersAndHolds, demoConsoleAnswersAndCloses} {
+ // The handler lingers for its bound here, so one case is enough.
+ cases = append(cases, demoDuplexCase{console: console, timing: demoSendsAfterHandler})
+ for _, timing := range []demoDuplexTiming{demoSendsAfterAnswer, demoSendsPipelined} {
+ cases = append(cases,
+ demoDuplexCase{console: console, timing: timing},
+ demoDuplexCase{console: console, timing: timing, chunked: true},
+ demoDuplexCase{console: console, timing: timing, expect: true},
+ // More than net/http will read for a handler that has returned.
+ demoDuplexCase{console: console, timing: timing, padding: 512 << 10},
+ )
+ }
+ // A console closing on an unread upload may reset its own answer away,
+ // and one holding its connection promised a keep-alive it will not
+ // serve: with the whole upload written, the transport would reuse it.
+ if console != demoConsoleAnswersAndCloses && console != demoConsoleAnswersAndHolds {
+ cases = append(cases, demoDuplexCase{console: console, timing: demoSendsWhole, padding: 128 << 10})
+ }
+ }
+ return cases
+}
+
+// The console is on this box: the alias's own reverse proxy.
+func TestDemoAPIAliasEarlyAnswerKeepAliveLocal(t *testing.T) {
+ logs := captureLog(t)
+ demoAPISettings(t)
+ e, err := New(openReg(t), nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(e.probers.Stop)
+ demoAPIArm(t, e)
+ s := &demoDuplexScene{}
+ t.Cleanup(s.closeHeld)
+ demoAPIBackend(t, e, s)
+ front := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ done := s.done.Load()
+ e.ServeHTTP(w, r)
+ if r.Method == http.MethodPost && done != nil {
+ close(*done)
+ }
+ }))
+ // Apart from the console's log: this is the connection under test.
+ edgeLogs := &lockedBuffer{}
+ front.Config.ErrorLog = log.New(edgeLogs, "", 0)
+ front.Start()
+ t.Cleanup(front.Close)
+ for _, c := range demoDuplexCases() {
+ t.Run(c.name(), func(t *testing.T) {
+ logs.Reset()
+ edgeLogs.Reset()
+ // The transport may have pooled a held connection, and the console
+ // will never answer on it again.
+ t.Cleanup(s.closeHeld)
+ s.console.Store(int32(c.console))
+ done := make(chan struct{})
+ s.done.Store(&done)
+ conn, err := net.Dial("tcp", front.Listener.Addr().String())
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer conn.Close()
+ outcome := runDemoDuplexCase(t, conn, s, c, done)
+ t.Logf("connection %s", outcome)
+ checkDemoDuplexPaths(t, s, outcome)
+ checkDemoDuplexLog(t, "the edge's server", edgeLogs)
+ checkDemoDuplexLog(t, "the console", logs)
+ })
+ }
+}
+
+// The console is on another box: the alias hops to it over the backhaul.
+func TestDemoAPIAliasEarlyAnswerKeepAliveHop(t *testing.T) {
+ logs := captureLog(t)
+ s := &demoDuplexScene{}
+ t.Cleanup(s.closeHeld)
+ scene := NewDemoAPITestIngress(t, s, release.NewDirStore(t.TempDir()))
+ for _, c := range demoDuplexCases() {
+ // This ingress offers no signal for its handler returning.
+ if c.timing == demoSendsAfterHandler {
+ continue
+ }
+ t.Run(c.name(), func(t *testing.T) {
+ logs.Reset()
+ // The transport may have pooled a held connection, and the console
+ // will never answer on it again.
+ t.Cleanup(s.closeHeld)
+ s.console.Store(int32(c.console))
+ conn, err := tls.Dial("tcp", scene.servers[1].Listener.Addr().String(), &tls.Config{RootCAs: scene.ca.pool, ServerName: demoAPISite, MinVersion: tls.VersionTLS12, NextProtos: []string{"http/1.1"}})
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer conn.Close()
+ outcome := runDemoDuplexCase(t, conn, s, c, nil)
+ t.Logf("connection %s", outcome)
+ checkDemoDuplexPaths(t, s, outcome)
+ checkDemoDuplexLog(t, "an edge or the console", logs)
+ })
+ }
+}
+
+// demoDuplexLocalFront is the alias on a real HTTP/1.1 server, with the
+// console on this box.
+func demoDuplexLocalFront(t *testing.T, s *demoDuplexScene) *httptest.Server {
+ t.Helper()
+ demoAPISettings(t)
+ e, err := New(openReg(t), nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(e.probers.Stop)
+ demoAPIArm(t, e)
+ t.Cleanup(s.closeHeld)
+ demoAPIBackend(t, e, s)
+ front := httptest.NewServer(e)
+ t.Cleanup(front.Close)
+ return front
+}
+
+// A client that stops sending after the early answer does not hold the
+// connection: the edge closes it at the linger bound.
+func TestDemoAPIAliasEarlyAnswerStalledUploadCloses(t *testing.T) {
+ s := &demoDuplexScene{}
+ front := demoDuplexLocalFront(t, s)
+ conn, err := net.Dial("tcp", front.Listener.Addr().String())
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer conn.Close()
+ if err := conn.SetDeadline(time.Now().Add(10 * time.Second)); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := io.WriteString(conn, "POST /api/demo/apps HTTP/1.1\r\nHost: "+demoAPISite+"\r\nContent-Length: 100\r\n\r\nstart"); err != nil {
+ t.Fatal(err)
+ }
+ br := bufio.NewReader(conn)
+ resp, err := http.ReadResponse(br, &http.Request{Method: http.MethodPost})
+ if err != nil {
+ t.Fatal(err)
+ }
+ if body, err := io.ReadAll(resp.Body); err != nil || resp.StatusCode != http.StatusForbidden || string(body) != demoDuplexRefusal || !resp.Close {
+ t.Fatalf("the early answer: %d %q close=%v, %v", resp.StatusCode, body, resp.Close, err)
+ }
+ if _, err := br.ReadByte(); !demoDuplexGone(err) {
+ t.Fatalf("the stalled connection: %v, want it closed", err)
+ }
+}
+
+// An upload the console read to its end before answering keeps its
+// connection, as every ordinary request does.
+func TestDemoAPIAliasWholeUploadKeepsConnection(t *testing.T) {
+ var calls atomic.Int32
+ reader := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ calls.Add(1)
+ io.Copy(io.Discard, r.Body)
+ io.WriteString(w, "ok")
+ })
+ demoAPISettings(t)
+ e, err := New(openReg(t), nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(e.probers.Stop)
+ demoAPIArm(t, e)
+ demoAPIBackend(t, e, reader)
+ front := httptest.NewServer(e)
+ t.Cleanup(front.Close)
+ conn, err := net.Dial("tcp", front.Listener.Addr().String())
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer conn.Close()
+ if err := conn.SetDeadline(time.Now().Add(10 * time.Second)); err != nil {
+ t.Fatal(err)
+ }
+ br := bufio.NewReader(conn)
+ for _, framing := range []string{"Content-Length: 5\r\n\r\nhello", "Transfer-Encoding: chunked\r\n\r\n5\r\nhello\r\n0\r\n\r\n"} {
+ if _, err := io.WriteString(conn, "POST /api/demo/apps HTTP/1.1\r\nHost: "+demoAPISite+"\r\n"+framing); err != nil {
+ t.Fatal(err)
+ }
+ resp, err := http.ReadResponse(br, &http.Request{Method: http.MethodPost})
+ if err != nil {
+ t.Fatal(err)
+ }
+ if body, err := io.ReadAll(resp.Body); err != nil || string(body) != "ok" || resp.Close {
+ t.Fatalf("%q: answer %q close=%v, %v", framing, body, resp.Close, err)
+ }
+ }
+ if calls.Load() != 2 {
+ t.Fatalf("%d requests reached the console on one connection, want 2", calls.Load())
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-small-fixes-1246-1248.tsv b/internal/provision/testdata/plan14-root-reads-small-fixes-1246-1248.tsv
index b1c9971b3..e31ebfa4e 100644
--- a/internal/provision/testdata/plan14-root-reads-small-fixes-1246-1248.tsv
+++ b/internal/provision/testdata/plan14-root-reads-small-fixes-1246-1248.tsv
@@ -1,5 +1,6 @@
# Census overlay small-fixes-1246-1248, written by census-propose (#369). census-ruling-small-fixes-1246-1248, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-small-fixes-1246-1248.md.
-# 1 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 1 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
@legacy a21f3817e4d7592b66b0229a58c87f6f7a9c59ad30d6e65fe6c1dd84dfe34ce3 internal/host/replicaplacement.go replicaPlacementWorker.run legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-2;basis=Final fix I3: retain completed lifetime/revision observations and skip their work; only confirmed current binding publication after coordinator acquisition, or existing successful/fenced retirement ACK, completes work. Existing local registry read, authority and retirement checks, and 30-second request deadline remain. No new reads or polling.;rev3=census-ruling-staticcheck-sa4006;basis=SA4006 dead store: publishCurrent's error is discarded explicitly (done, _ =) with a comment; it was assigned to err and never read, and publishCurrent returns false with every error, so done and the retry backoff are exactly as before. No read added, read sites unchanged (6).;rev3=census-ruling-small-fixes-1246-1248;basis=Logs the retire, acquire and publish failures it used to drop, at most once per backoff step, outside the worker lock. The retry decision, backoff arithmetic, deadlines and read sites are unchanged (6); no read added. registry:ReplicaIncarnation@1337,registry:ReplicaRevision@1369,whole:Route@1049,whole:Route@1324,whole:Route@1843,whole:Route@897 8d4b85a98c41b8ad7736163024cd0cef3b0f0687e1e6f76fdee509cd56a27459
internal/host/replicaplacement.go replicaPlacementWorker.run legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-2;basis=Final fix I3: retain completed lifetime/revision observations and skip their work; only confirmed current binding publication after coordinator acquisition, or existing successful/fenced retirement ACK, completes work. Existing local registry read, authority and retirement checks, and 30-second request deadline remain. No new reads or polling.;rev3=census-ruling-staticcheck-sa4006;basis=SA4006 dead store: publishCurrent's error is discarded explicitly (done, _ =) with a comment; it was assigned to err and never read, and publishCurrent returns false with every error, so done and the retry backoff are exactly as before. No read added, read sites unchanged (6).;rev3=census-ruling-small-fixes-1246-1248;basis=Logs the retire, acquire and publish failures it used to drop, at most once per backoff step, outside the worker lock. The retry decision, backoff arithmetic, deadlines and read sites are unchanged (6); no read added. registry:ReplicaIncarnation@1337,registry:ReplicaRevision@1369,whole:Route@1049,whole:Route@1324,whole:Route@1843,whole:Route@897 8d4b85a98c41b8ad7736163024cd0cef3b0f0687e1e6f76fdee509cd56a27459
+@coverage internal/edge 5a957f25e2c8ec67ea1ee494bc3b12a4f9cfbe26f1db4890d5bf925da06eae39
@coverage internal/host 97ba6b1d1eb103f39aca148b55efad35e3aebec68614ac5462ea38fbff41391e