From 577ec052055fa4bf3f9b1ec21405b95278610ed1 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 17:29:44 +0100 Subject: [PATCH] Design 47 H1: the runner says a mover waits on its registration when placed from the half or the queue (A-327) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A pipeline placed at its turn in the queue, or once its branch's half was held, dropped its movers with no registration without a word: main.20 and main.22 sat running with every step ended and nothing said why (their mover mesh-delivery-contracts has no registration, so it is never placed and the pipeline never ends). Builds: design 47 G A-327, design 47 H §746 --- .../internal/pipeline/start.go | 7 ++++++- .../internal/pipeline/start_test.go | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/mesh-delivery-pipeline/internal/pipeline/start.go b/modules/mesh-delivery-pipeline/internal/pipeline/start.go index b85ca084..d9ae597d 100644 --- a/modules/mesh-delivery-pipeline/internal/pipeline/start.go +++ b/modules/mesh-delivery-pipeline/internal/pipeline/start.go @@ -610,7 +610,12 @@ func (s *Starter) placeWaiting(store Updater, due func(seat.Pipeline) bool, reg continue } before := len(p.Steps) - asks, _, ended, notAsked := s.placeMovers(&p, reg, half.Entries, now) + asks, unregistered, ended, notAsked := s.placeMovers(&p, reg, half.Entries, now) + // Until its registration arrives, the pipeline says it waits on it (A-327): a mover with no registration has no step, + // and the pipeline does not end before it is placed. + for _, m := range unregistered { + s.logf("%s: %s has no registration yet: its steps wait on its registration, which places them (A-327)", key, m) + } if len(p.Steps) == before { continue } diff --git a/modules/mesh-delivery-pipeline/internal/pipeline/start_test.go b/modules/mesh-delivery-pipeline/internal/pipeline/start_test.go index edb8d2fa..019127c7 100644 --- a/modules/mesh-delivery-pipeline/internal/pipeline/start_test.go +++ b/modules/mesh-delivery-pipeline/internal/pipeline/start_test.go @@ -3,6 +3,8 @@ package pipeline import ( "encoding/json" "errors" + "fmt" + "slices" "strings" "testing" @@ -280,6 +282,23 @@ func TestAPipelineStartedBeforeItsRegistrationIsPlacedWhenItArrives(t *testing.T if n != 1 || err != nil || len(p.Steps) == 0 || len(asks.asks) == before { t.Errorf("the pipeline a runner before this one set aside: placed %d (%v), %d steps, %d asks more, want it started as a newly started one", n, err, len(p.Steps), len(asks.asks)-before) } + + // A-327: a mover with no registration, in a pipeline placed from the half held later (the queue's turn, the half held), + // is said to wait on its registration, so the pipeline that cannot end before it is placed says why. + var logged []string + s.Logf = func(f string, a ...any) { logged = append(logged, fmt.Sprintf(f, a...)) } + held = false + taken = catalog.TakeInTaken{Branch: "next", Source: 8, Entries: []catalog.TakeInEntry{{Module: "app", Commit: "c4", Fingerprint: "src2:dd"}, {Module: "contracts", Commit: "c4", Fingerprint: "src2:ee"}}} + if n, err := s.TakenIn(taken, late); n != 1 || err != nil { + t.Fatalf("the take-in of two movers started %d (%v)", n, err) + } + held, logged = true, nil + if n, err := s.Waiting(store.memStore, "next", late); n != 1 || err != nil { + t.Fatalf("the half of next placed %d (%v), want next.8's registered mover", n, err) + } + if !slices.ContainsFunc(logged, func(l string) bool { return strings.Contains(l, "next.8: contracts has no registration yet") }) { + t.Errorf("placing next.8 said %q, want that contracts waits on its registration (A-327)", logged) + } } // R1/AC1 (design 47 H §747): a start names an event, never a sweep. A take-in starts the pipelines of its own entries