From af61faf7064c1c0b6346021b29aa56a29b92ea4c Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 15 Nov 2026 15:46:24 +0100 Subject: [PATCH] teller: give the assigner's asks every place the router gives the teller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ask of proposal p-20261115t143855-09a7bc never reached the operator: the teller kept it waiting for room, since two old asks of the assigner (mailu's restore and hold, open since 2026-11-14) filled the two places it allowed, one being kept free for the merge ask, which went with the Approve per merge (design 47 G §653). The assigner's are the only asks the teller makes at the router now, so they take every place it gives (occ.MostOpen). Builds: design 47 G §653 --- .../cmd/mesh-delivery-teller/assignerasks.go | 12 ++++++------ .../cmd/mesh-delivery-teller/assignerasks_test.go | 4 ++-- .../cmd/mesh-delivery-teller/teller_test.go | 13 ++++++++----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/assignerasks.go b/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/assignerasks.go index 9b48d69e..f9564d98 100644 --- a/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/assignerasks.go +++ b/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/assignerasks.go @@ -24,11 +24,11 @@ import ( // under the ask's own key in the bucket answers, which the assigner reads (mesh-delivery-assigner pass.go answeredWith); none // of these asks needs proof of who answered (mesh-sdk go/delivery AskNeedsProof). -// mostAssignerOpen is how many of the assigner's asks the teller keeps open at the router at once. The router keeps at most -// occ.MostOpen open asks of one asker, and a burst of holds (seven at once on 2026-10-25) would take all the room; one place -// stays free (it was left for the merge ask, which went with the Approve per merge, design 47 G §653). An assigner ask beyond -// these waits in the wait for room and is asked when one of them ends. -const mostAssignerOpen = occ.MostOpen - 1 +// mostAssignerOpen is how many of the assigner's asks the teller keeps open at the router at once: every place the router gives +// one asker (occ.MostOpen). The assigner's are the only asks the teller makes there since the Approve per merge went (design 47 +// G §653), so no place is kept free for a merge ask any more: two old asks no longer leave a third, a proposal's, waiting with +// none open beside them. An assigner ask beyond these waits in the wait for room and is asked when one of them ends. +const mostAssignerOpen = occ.MostOpen // assignerOpenRecord is the key of the router ids of the assigner's asks the teller asked. const assignerOpenRecord = "assigner.open" @@ -85,7 +85,7 @@ func (t *Teller) waitForAssignerRoom(key, id string) { return } if t.keepWaiting(append(ws, waitingAsk{Key: key, ID: id}), rec) == nil { - t.logf("%s: the assigner's ask %s waits: %d of the assigner's asks are open, the most the teller keeps open so a merge ask always has room", key, id, mostAssignerOpen) + t.logf("%s: the assigner's ask %s waits: %d of the assigner's asks are open, every place the router gives the teller", key, id, mostAssignerOpen) } } diff --git a/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/assignerasks_test.go b/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/assignerasks_test.go index fe7ca68d..91d2269d 100644 --- a/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/assignerasks_test.go +++ b/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/assignerasks_test.go @@ -201,8 +201,8 @@ func TestABurstOfHoldsAsksNoMoreThanTheMostOpenAndTheNextWhenOneEnds(t *testing. } b.deliver(t, ackFor(held[0], "release")) got := b.askedIDs() - if len(got) != mostAssignerOpen+1 || got[len(got)-1] != held[2].ID { - t.Fatalf("asked %v after a hold was answered, want the third hold asked next; log:\n%s", got, b.logs.String()) + if len(got) != mostAssignerOpen+1 || got[len(got)-1] != held[mostAssignerOpen].ID { + t.Fatalf("asked %v after a hold was answered, want the next waiting hold asked next; log:\n%s", got, b.logs.String()) } } diff --git a/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/teller_test.go b/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/teller_test.go index 9ddb8565..5c0f826c 100644 --- a/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/teller_test.go +++ b/modules/mesh-delivery-teller/cmd/mesh-delivery-teller/teller_test.go @@ -278,7 +278,8 @@ func TestAnAssignersKeyBecomesOneRouterAskAndDeletingItCancelsIt(t *testing.T) { t.Errorf("the ask was cancelled %d times", n) } // Issue 774: teller_end_ask ends one by hand, named by its key or its router id; the router's word that it ended asks the - // one waiting for room again (the assigner's asks hold at most mostAssignerOpen places, the third waits). + // one waiting for room again (the assigner's asks hold at most mostAssignerOpen places, every one the router gives, design 47 + // G §653: the fourth waits). for _, c := range []struct { name string by func(key string, ask oc.Ask) string @@ -290,14 +291,15 @@ func TestAnAssignersKeyBecomesOneRouterAskAndDeletingItCancelsIt(t *testing.T) { b := newBed(t) k1, first := b.holdOf(t, 1, 1) b.holdOf(t, 2, 1) - _, third := b.holdOf(t, 3, 1) + b.holdOf(t, 3, 1) + _, third := b.holdOf(t, 4, 1) r := b.t.EndAsk(c.by(k1, first), "the hold no longer holds", "lead@shanks") cancels := b.askedOf(oc.AcceptSubjectCancel(tellerModule)) if !r.Ended || r.ID != first.ID || r.Key != k1 || len(cancels) != 1 || string(cancels[0].body) != `{"id":"`+first.ID+`"}` { t.Fatalf("end = %+v, cancels %+v", r, cancels) } b.deliver(t, oc.Warrant{Ask: first.ID, Asker: tellerModule, Outcome: occ.OutcomeCancelled, At: occ.FormatTime(now), AskDigest: occ.Digest(first)}) - if got := b.askedIDs(); len(got) != 3 || got[2] != third.ID { + if got := b.askedIDs(); len(got) != 4 || got[3] != third.ID { t.Errorf("asks = %v, want the waiting %s asked once the ask ended by hand left", got, third.ID) } if again := b.t.EndAsk(k1, "again", "lead@shanks"); again.Ended || len(b.askedOf(oc.AcceptSubjectCancel(tellerModule))) != 1 { @@ -309,12 +311,13 @@ func TestAnAssignersKeyBecomesOneRouterAskAndDeletingItCancelsIt(t *testing.T) { b := newBed(t) _, first := b.holdOf(t, 1, 1) b.holdOf(t, 2, 1) - _, third := b.holdOf(t, 3, 1) + b.holdOf(t, 3, 1) + _, third := b.holdOf(t, 4, 1) if r := b.t.EndAsk(third.ID, "asked about what no longer holds", "lead@shanks"); !r.Ended || len(b.askedOf(oc.AcceptSubjectCancel(tellerModule))) != 0 { t.Fatalf("end of a waiting ask = %+v", r) } b.deliver(t, warrantFor(first, "keep")) - if got := b.askedIDs(); len(got) != 2 { + if got := b.askedIDs(); len(got) != 3 { t.Errorf("asks = %v: the ask ended while it waited was asked again", got) } if r := b.t.EndAsk("hold.nothing.here", "a typo", "lead@shanks"); r.Ended || !strings.Contains(r.Says, "holds no ask") {