diff --git a/docs/plans/p5a/README.md b/docs/plans/p5a/README.md index fb1fdfc..771c3bb 100644 --- a/docs/plans/p5a/README.md +++ b/docs/plans/p5a/README.md @@ -43,4 +43,10 @@ reaches orion until the owner's review, the merge, and straylight's pin bump. ## Changes during the run -(none yet) +- 2026-09-25, task 01: **owner test fault.** `TestFetchIf` took its mutex with `defer mu.Unlock()` + and then made a third request, whose server handler needs that mutex: a deadlock that surfaced as + a 20 s upstream timeout. Ornith spent 55 minutes debugging it correctly (its notes had the + handler blocked on `mu.Lock` at the test line) and ended on a refused `/tmp` read, with the + implementation done but debug prints in `pdf.go` and a `zz_debug_test.go`. Owner fixed the test + (copy the slice under the lock, release before the next request), removed the debug scaffolding, + and resumed the session to finish and commit. diff --git a/docs/plans/p5a/_files/internal/fetch/pdf_test.go b/docs/plans/p5a/_files/internal/fetch/pdf_test.go index 00f1b89..9f3c557 100644 --- a/docs/plans/p5a/_files/internal/fetch/pdf_test.go +++ b/docs/plans/p5a/_files/internal/fetch/pdf_test.go @@ -167,9 +167,10 @@ func TestFetchIf(t *testing.T) { t.Fatalf("changed document: res %+v err %v; want 200 with the new body and ETag", res, err) } mu.Lock() - defer mu.Unlock() - if len(got) != 2 || got[0] != `"v1"|` || got[1] != `"old"|Thu, 24 Sep 2026 12:00:00 GMT` { - t.Errorf("validators sent: %q", got) + sent := append([]string(nil), got...) + mu.Unlock() // never hold mu across another request: the handler takes it + if len(sent) != 2 || sent[0] != `"v1"|` || sent[1] != `"old"|Thu, 24 Sep 2026 12:00:00 GMT` { + t.Errorf("validators sent: %q", sent) } // With no validators FetchIf is a plain Fetch. if _, err := f.FetchIf(context.Background(), ts.URL, "", ""); err != nil {