steprun: the asker judgement goes; every asker's kind is taken
The step runner no longer reads the seat list for the callers a build seat's definition lists, refuses an asker it does not name, or gives an ask back until the list says: Puller.Callers, CallersFromDefinitions, SeatListCallers and the seat list reader's start go, since no seat definition names callers and every account may call every verb. The step is still keyed under the asker its subject names, and main's subject still takes only a build, a run and the checker's check and recheck. mesh-delivery-sdk builds again against mesh-sdk without seatdef callers. Builds: design 47 H §752, §764 (every seat contract: the callers lists); lead answers H-A-41, H-A-66, H-A-71 (3) Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -3,22 +3,15 @@ package steprun
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"slices"
|
|
||||||
"strings"
|
|
||||||
"sync/atomic"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
buildrun "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildrun"
|
buildrun "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildrun"
|
||||||
sdkstep "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep"
|
sdkstep "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep"
|
||||||
stdio "git.novox.be/novox/mesh-sdk/go"
|
|
||||||
"git.novox.be/novox/mesh-sdk/go/seatdef"
|
|
||||||
"git.novox.be/novox/mesh-sdk/go/seatlist"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// **A holder refuses a kind its asker may not ask** (design 47 G §543, A-163, A-170). An ask rides
|
// **A holder takes every asker's kind** (design 47 H §752, H-A-41: every account may call every verb; the asker judgement
|
||||||
// `mesh.seat.<seat>.accept.<queue>.<asker>`, the asker the asking seat's own name, and its kind stays in its body. The
|
// goes). An ask rides `mesh.seat.<seat>.accept.<queue>.<asker>`, the asker the asking seat's own name, and its kind stays in
|
||||||
// holder takes the asker from the subject and checks the kind against the callers the seat's definition lists for it (read
|
// its body; the holder keys the step under that asker (design 47 G §481). On main's subject, which names no asker, it takes
|
||||||
// from the seat list); on main's subject, which names no asker, it takes only a build and a run.
|
// only a build and a run (design 47 G §543, A-184).
|
||||||
|
|
||||||
// KindOf is the word the seat definition gives an ask's kind: run for a run or a compose, else the ask's own kind.
|
// KindOf is the word the seat definition gives an ask's kind: run for a run or a compose, else the ask's own kind.
|
||||||
func KindOf(ask sdkstep.StepAsk) string {
|
func KindOf(ask sdkstep.StepAsk) string {
|
||||||
@@ -28,67 +21,24 @@ func KindOf(ask sdkstep.StepAsk) string {
|
|||||||
return ask.Kind
|
return ask.Kind
|
||||||
}
|
}
|
||||||
|
|
||||||
// CallersFromDefinitions is a Puller.Callers: the seats the definition of language's build seat lists as callers of an
|
// askerRefusal is why an ask must not be taken from its subject: "" when it may be. Any named asker may ask any kind.
|
||||||
// accepted kind, from the seat list's definitions (seatlist.Reader.Definitions). found is false when the definition or the
|
func (p *Puller) askerRefusal(msg *Pulled, ask sdkstep.StepAsk) (why string) {
|
||||||
// kind is not held yet. A caller entry is `seat:<name>`.
|
|
||||||
func CallersFromDefinitions(language string, definitions func() map[string]seatdef.Definition) func(kind string) (callers []string, found bool) {
|
|
||||||
return func(kind string) ([]string, bool) {
|
|
||||||
seat, err := sdkstep.BuildSeat(language)
|
|
||||||
if err != nil {
|
|
||||||
return nil, false
|
|
||||||
}
|
|
||||||
def, ok := definitions()[seat]
|
|
||||||
if !ok {
|
|
||||||
return nil, false
|
|
||||||
}
|
|
||||||
var out []string
|
|
||||||
found := false
|
|
||||||
for _, m := range def.Accepts {
|
|
||||||
if m.Name != kind {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
found = true
|
|
||||||
if m.Callers != nil {
|
|
||||||
for _, e := range m.Callers.List {
|
|
||||||
if name, ok := strings.CutPrefix(e, "seat:"); ok {
|
|
||||||
out = append(out, name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return out, found
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// askerRefusal is why an ask must not be taken from its subject's asker: "" when it may be, and judged false when the seat
|
|
||||||
// list does not say yet (the ask is given back, not refused).
|
|
||||||
func (p *Puller) askerRefusal(msg *Pulled, ask sdkstep.StepAsk) (why string, judged bool) {
|
|
||||||
if msg.Subject == "" {
|
if msg.Subject == "" {
|
||||||
return "", true // a source that gives no subject (a test's)
|
return "" // a source that gives no subject (a test's)
|
||||||
}
|
}
|
||||||
_, _, asker, err := sdkstep.ParseAskSubjectBy(msg.Subject)
|
_, _, asker, err := sdkstep.ParseAskSubjectBy(msg.Subject)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Sprintf("the ask came on %s, which is no accept subject of this seat", msg.Subject), true
|
return fmt.Sprintf("the ask came on %s, which is no accept subject of this seat", msg.Subject)
|
||||||
}
|
}
|
||||||
kind := KindOf(ask)
|
kind := KindOf(ask)
|
||||||
if asker == "" {
|
if asker == "" {
|
||||||
// Main's subject takes a build, a run and, until it goes, the checker's check and recheck (design 47 G A-184, §543).
|
// Main's subject takes a build, a run and, until it goes, the checker's check and recheck (design 47 G A-184, §543).
|
||||||
if (ask.Build != nil && ask.Kind == sdkstep.AskDelivery) || kind == "run" || kind == sdkstep.AskCheck || kind == sdkstep.AskRecheck {
|
if (ask.Build != nil && ask.Kind == sdkstep.AskDelivery) || kind == "run" || kind == sdkstep.AskCheck || kind == sdkstep.AskRecheck {
|
||||||
return "", true
|
return ""
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("the kind %s is not taken on main's subject, which takes only a build, a run and the checker's check and recheck (asker: none named)", kind), true
|
return fmt.Sprintf("the kind %s is not taken on main's subject, which takes only a build, a run and the checker's check and recheck (asker: none named)", kind)
|
||||||
}
|
}
|
||||||
if p.Callers == nil {
|
return ""
|
||||||
return "", true
|
|
||||||
}
|
|
||||||
callers, found := p.Callers(kind)
|
|
||||||
if !found {
|
|
||||||
return "", false
|
|
||||||
}
|
|
||||||
if !slices.Contains(callers, asker) {
|
|
||||||
return fmt.Sprintf("the kind %s is not one %s may ask: its callers are %s", kind, asker, strings.Join(callers, ", ")), true
|
|
||||||
}
|
|
||||||
return "", true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// refuseAsker ends an ask whose asker may not ask its kind: its step key says failed with the reason, naming the kind and the
|
// refuseAsker ends an ask whose asker may not ask its kind: its step key says failed with the reason, naming the kind and the
|
||||||
@@ -143,87 +93,3 @@ func PriorRuns(get func(key string) (json.RawMessage, error)) func(string) int {
|
|||||||
return s.Run
|
return s.Run
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// giveBack hands an ask back to be judged again a little later, once the seat list says more. Why it cannot be judged is
|
|
||||||
// said once per change by the callers (SeatListCallers), not once per ask.
|
|
||||||
func (p *Puller) giveBack(msg *Pulled, ask sdkstep.StepAsk) {
|
|
||||||
if msg.NakAfter != nil && msg.NakAfter(DefaultPullWait) == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_ = msg.Nak()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Seat list start retries: the first wait and its cap (a failed start is tried again, 1s doubling to 1 minute).
|
|
||||||
const (
|
|
||||||
seatListRetryFirst = time.Second
|
|
||||||
seatListRetryMax = time.Minute
|
|
||||||
)
|
|
||||||
|
|
||||||
// startSeatList tries start until it succeeds: each failure is said with its next try, the success once. wait is the
|
|
||||||
// pause a test replaces; the reader is returned once started (design 47 G §543, A-163, lead-47 2026-11-15: the reader's
|
|
||||||
// start is retried).
|
|
||||||
func startSeatList(start func() (*seatlist.Reader, error), wait func(time.Duration), logf func(format string, args ...any)) *seatlist.Reader {
|
|
||||||
if logf == nil {
|
|
||||||
logf = func(string, ...any) {}
|
|
||||||
}
|
|
||||||
delay := seatListRetryFirst
|
|
||||||
for {
|
|
||||||
r, err := start()
|
|
||||||
if err == nil {
|
|
||||||
logf("the seat list is followed")
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
logf("following the seat list: %v; the asks are given back, the next try in %s", err, delay)
|
|
||||||
wait(delay)
|
|
||||||
delay = min(delay*2, seatListRetryMax)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// SeatListCallers is a Puller.Callers that follows the seat list: it starts the reader once the runtime serves
|
|
||||||
// (seatlist.Start through the runtime's own way in) and answers from its definitions, found false until it has read them.
|
|
||||||
// A reader that cannot start is said and tried again with backoff while the asks are given back (design 47 G §543, A-163);
|
|
||||||
// why an ask is given back (reader not started, definition of the seat not held, kind not in it) is said once per change.
|
|
||||||
func SeatListCallers(language string, logf func(format string, args ...any)) func(kind string) ([]string, bool) {
|
|
||||||
var reader atomic.Pointer[seatlist.Reader]
|
|
||||||
go func() {
|
|
||||||
<-stdio.Served()
|
|
||||||
reader.Store(startSeatList(func() (*seatlist.Reader, error) {
|
|
||||||
return seatlist.Start(seatlist.Config{Bus: seatlist.StdioBus(), Bootstrap: seatlist.Bootstrapped()})
|
|
||||||
}, time.Sleep, logf))
|
|
||||||
}()
|
|
||||||
return callersOf(language, reader.Load, logf)
|
|
||||||
}
|
|
||||||
|
|
||||||
// callersOf answers from the reader once started, saying once per change why a kind is not found.
|
|
||||||
func callersOf(language string, reader func() *seatlist.Reader, logf func(format string, args ...any)) func(kind string) ([]string, bool) {
|
|
||||||
var said atomic.Value // the last reason said
|
|
||||||
say := func(why string) {
|
|
||||||
if prev, _ := said.Swap(why).(string); prev != why && logf != nil {
|
|
||||||
logf("the asks are given back: %s", why)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return func(kind string) ([]string, bool) {
|
|
||||||
r := reader()
|
|
||||||
if r == nil {
|
|
||||||
say("the seat list reader is not started yet")
|
|
||||||
return nil, false
|
|
||||||
}
|
|
||||||
defs := r.Definitions()
|
|
||||||
seat, err := sdkstep.BuildSeat(language)
|
|
||||||
if err != nil {
|
|
||||||
say("the build seat of " + language + " is unknown: " + err.Error())
|
|
||||||
return nil, false
|
|
||||||
}
|
|
||||||
if _, ok := defs[seat]; !ok {
|
|
||||||
say("the seat list holds no definition of the seat " + seat)
|
|
||||||
return nil, false
|
|
||||||
}
|
|
||||||
callers, found := CallersFromDefinitions(language, func() map[string]seatdef.Definition { return defs })(kind)
|
|
||||||
if !found {
|
|
||||||
say("the definition of " + seat + " does not accept the kind " + kind)
|
|
||||||
} else {
|
|
||||||
said.Store("")
|
|
||||||
}
|
|
||||||
return callers, found
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,45 +2,34 @@ package steprun
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
sdkstep "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep"
|
sdkstep "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep"
|
||||||
"git.novox.be/novox/mesh-sdk/go/seatdef"
|
|
||||||
"git.novox.be/novox/mesh-sdk/go/seatlist"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func callersFor(table map[string][]string) func(string) ([]string, bool) {
|
// Design 47 H §752, H-A-41: every account may ask every kind, so an ask of any asker its subject names runs, keyed under
|
||||||
return func(kind string) ([]string, bool) { c, ok := table[kind]; return c, ok }
|
// that asker, and none is given back to be judged; a step on main's subject, which names no asker, is refused (design 47 G
|
||||||
}
|
// §543, A-184: main's subject takes a build, a run and the checker's check and recheck).
|
||||||
|
func TestPullTakesEveryAskersKind(t *testing.T) {
|
||||||
// Design 47 G §543 (BG2, BG3, A-163, A-170): an ask whose kind its asker, the last token of its subject, is no caller of is
|
|
||||||
// answered error naming the kind and the asker and ended failed; a step on main's subject is refused as well (its check and recheck
|
|
||||||
// taken, A-184); one the
|
|
||||||
// seat list does not judge yet is given back.
|
|
||||||
func TestPullRefusesAKindItsAskerMayNotAsk(t *testing.T) {
|
|
||||||
step := testAsk(sdkstep.AskStep)
|
step := testAsk(sdkstep.AskStep)
|
||||||
step.Check = nil
|
step.Check = nil
|
||||||
step.Step = &sdkstep.StepRun{Pipeline: "p", Step: sdkstep.StepUnit, Module: "m", Artifact: "m:a", Commit: "0123456789abcdef0123456789abcdef01234567",
|
step.Step = &sdkstep.StepRun{Pipeline: "p", Step: sdkstep.StepUnit, Module: "m", Artifact: "m:a", Commit: "0123456789abcdef0123456789abcdef01234567",
|
||||||
Fingerprint: "fp", Fetch: sdkstep.Fetch{Repository: "novox/x", Commit: "0123456789abcdef0123456789abcdef01234567"}}
|
Fingerprint: "fp", Fetch: sdkstep.Fetch{Repository: "novox/x", Commit: "0123456789abcdef0123456789abcdef01234567"}}
|
||||||
build := testAsk(sdkstep.AskDelivery)
|
build := testAsk(sdkstep.AskDelivery)
|
||||||
table := map[string][]string{"step": {"mesh-pipeline-runner"}, "delivery": {"mesh-builds"}}
|
|
||||||
for _, c := range []struct {
|
for _, c := range []struct {
|
||||||
name, subject string
|
name, subject string
|
||||||
ask sdkstep.StepAsk
|
ask sdkstep.StepAsk
|
||||||
callers func(string) ([]string, bool)
|
want string // "" runs it, "refused" refuses it
|
||||||
want string // "" runs it, "refused" refuses it, "back" gives it back
|
|
||||||
}{
|
}{
|
||||||
{"the indexer's step", "mesh.seat.node-build-go.accept.check.mesh-catalog", step, callersFor(table), "refused"},
|
{"the indexer's step", "mesh.seat.node-build-go.accept.check.mesh-catalog", step, ""},
|
||||||
{"the runner's step", "mesh.seat.node-build-go.accept.check.mesh-pipeline-runner", step, callersFor(table), ""},
|
{"the runner's step", "mesh.seat.node-build-go.accept.check.mesh-pipeline-runner", step, ""},
|
||||||
{"a step on main's subject", "mesh.seat.node-build-go.accept.check", step, callersFor(table), "refused"},
|
{"a step on main's subject", "mesh.seat.node-build-go.accept.check", step, "refused"},
|
||||||
{"a build on main's subject", "mesh.seat.node-build-go.accept.delivery", build, callersFor(table), ""},
|
{"a build on main's subject", "mesh.seat.node-build-go.accept.delivery", build, ""},
|
||||||
// A-184: until main's subject goes, it also takes the checker's check and recheck asks.
|
// A-184: until main's subject goes, it also takes the checker's check and recheck asks.
|
||||||
{"the checker's check on main's subject", "mesh.seat.node-build-go.accept.check", testAsk(sdkstep.AskCheck), callersFor(table), ""},
|
{"the checker's check on main's subject", "mesh.seat.node-build-go.accept.check", testAsk(sdkstep.AskCheck), ""},
|
||||||
{"the checker's recheck on main's subject", "mesh.seat.node-build-go.accept.recheck", testAsk(sdkstep.AskRecheck), callersFor(table), ""},
|
{"the checker's recheck on main's subject", "mesh.seat.node-build-go.accept.recheck", testAsk(sdkstep.AskRecheck), ""},
|
||||||
{"a kind the seat list does not hold", "mesh.seat.node-build-go.accept.check.mesh-pipeline-runner", step, callersFor(nil), "back"},
|
|
||||||
} {
|
} {
|
||||||
t.Run(c.name, func(t *testing.T) {
|
t.Run(c.name, func(t *testing.T) {
|
||||||
src, st, sy := NewFakeAsks(), newSteps(), &sayer{}
|
src, st, sy := NewFakeAsks(), newSteps(), &sayer{}
|
||||||
@@ -52,7 +41,7 @@ func TestPullRefusesAKindItsAskerMayNotAsk(t *testing.T) {
|
|||||||
src.PublishWithSubject(queue, raw, c.subject)
|
src.PublishWithSubject(queue, raw, c.subject)
|
||||||
_, _, asker, _ := sdkstep.ParseAskSubjectBy(c.subject)
|
_, _, asker, _ := sdkstep.ParseAskSubjectBy(c.subject)
|
||||||
ran := make(chan struct{}, 1)
|
ran := make(chan struct{}, 1)
|
||||||
p := &Puller{Source: src, Language: sdkstep.AskGo, Node: "shanks", Put: st.put, Capacity: func() int { return 1 }, Callers: c.callers,
|
p := &Puller{Source: src, Language: sdkstep.AskGo, Node: "shanks", Put: st.put, Capacity: func() int { return 1 },
|
||||||
PullWait: 5 * time.Millisecond, Heartbeat: time.Hour, Say: sy.say, ProgressEvery: time.Hour,
|
PullWait: 5 * time.Millisecond, Heartbeat: time.Hour, Say: sy.say, ProgressEvery: time.Hour,
|
||||||
Run: func(context.Context, sdkstep.StepAsk) (any, error) { ran <- struct{}{}; return nil, nil }}
|
Run: func(context.Context, sdkstep.StepAsk) (any, error) { ran <- struct{}{}; return nil, nil }}
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
@@ -79,58 +68,7 @@ func TestPullRefusesAKindItsAskerMayNotAsk(t *testing.T) {
|
|||||||
t.Fatal("a refused ask ran")
|
t.Fatal("a refused ask ran")
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
case "back":
|
|
||||||
waitFor(t, "the ask given back", func() bool { src.mu.Lock(); defer src.mu.Unlock(); return len(src.Delayed) > 0 })
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCallersFromDefinitionsReadsTheSeatsCallers(t *testing.T) {
|
|
||||||
def := seatdef.Definition{Seat: "node-build-go", Accepts: []seatdef.Message{
|
|
||||||
{Name: "step", Callers: &seatdef.Callers{List: []string{"seat:mesh-pipeline-runner"}}}}}
|
|
||||||
callers := CallersFromDefinitions(sdkstep.AskGo, func() map[string]seatdef.Definition { return map[string]seatdef.Definition{"node-build-go": def} })
|
|
||||||
if got, ok := callers("step"); !ok || len(got) != 1 || got[0] != "mesh-pipeline-runner" {
|
|
||||||
t.Fatalf("callers of step = %v, %v", got, ok)
|
|
||||||
}
|
|
||||||
if _, ok := callers("run"); ok {
|
|
||||||
t.Fatal("a kind the definition does not list is found")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestStartSeatListRetriesWithBackoffAndSaysIt(t *testing.T) {
|
|
||||||
var lines []string
|
|
||||||
var waits []time.Duration
|
|
||||||
tries := 0
|
|
||||||
start := func() (*seatlist.Reader, error) {
|
|
||||||
tries++
|
|
||||||
if tries <= 8 {
|
|
||||||
return nil, fmt.Errorf("binding the consumer: context deadline exceeded")
|
|
||||||
}
|
|
||||||
return &seatlist.Reader{}, nil
|
|
||||||
}
|
|
||||||
r := startSeatList(start, func(d time.Duration) { waits = append(waits, d) }, func(f string, a ...any) { lines = append(lines, fmt.Sprintf(f, a...)) })
|
|
||||||
if r == nil || tries != 9 || len(waits) != 8 {
|
|
||||||
t.Fatalf("reader %v tries %d waits %v", r, tries, waits)
|
|
||||||
}
|
|
||||||
if waits[0] != time.Second || waits[1] != 2*time.Second || waits[7] != time.Minute {
|
|
||||||
t.Fatalf("waits = %v, want 1s doubling to 1m", waits)
|
|
||||||
}
|
|
||||||
if len(lines) != 9 || !strings.Contains(lines[0], "next try in 1s") || lines[8] != "the seat list is followed" {
|
|
||||||
t.Fatalf("lines = %q", lines)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestCallersOfSaysWhyOncePerChange(t *testing.T) {
|
|
||||||
var lines []string
|
|
||||||
var r *seatlist.Reader
|
|
||||||
c := callersOf(sdkstep.AskGo, func() *seatlist.Reader { return r }, func(f string, a ...any) { lines = append(lines, fmt.Sprintf(f, a...)) })
|
|
||||||
for range 3 {
|
|
||||||
if _, ok := c("step"); ok {
|
|
||||||
t.Fatal("found without a reader")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(lines) != 1 || !strings.Contains(lines[0], "not started yet") {
|
|
||||||
t.Fatalf("lines = %q", lines)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -87,9 +87,6 @@ type Puller struct {
|
|||||||
// as the object named object, which the key and a run's step-ended name and the seat's verb `output` answers (A-254); a
|
// as the object named object, which the key and a run's step-ended name and the seat's verb `output` answers (A-254); a
|
||||||
// holder keeps it in the object store its manifest requires. Nil keeps none: such an answer ends the ask failed, saying so.
|
// holder keeps it in the object store its manifest requires. Nil keeps none: such an answer ends the ask failed, saying so.
|
||||||
KeepOutput func(object string, body []byte) error
|
KeepOutput func(object string, body []byte) error
|
||||||
// Callers says which seats the build seat's definition lists as callers of an accepted kind (CallersFromDefinitions);
|
|
||||||
// found is false while the seat list holds no such kind. Nil checks no named asker (design 47 G §543, A-163).
|
|
||||||
Callers func(kind string) (callers []string, found bool)
|
|
||||||
// Prior says how many runs of the ask under a step key started before (the Run of the step the key holds, PriorRuns; 0 for
|
// Prior says how many runs of the ask under a step key started before (the Run of the step the key holds, PriorRuns; 0 for
|
||||||
// none), so the poison rule and the transport fault's run count only runs that started, never an ask given back before it
|
// none), so the poison rule and the transport fault's run count only runs that started, never an ask given back before it
|
||||||
// ran. Nil counts the bus's deliveries (a test's).
|
// ran. Nil counts the bus's deliveries (a test's).
|
||||||
@@ -710,10 +707,7 @@ func (p *Puller) take(ctx context.Context, msg *Pulled) {
|
|||||||
p.endUnrun(msg, ask, key, step, prior)
|
p.endUnrun(msg, ask, key, step, prior)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if why, judged := p.askerRefusal(msg, ask); !judged {
|
if why := p.askerRefusal(msg, ask); why != "" {
|
||||||
p.giveBack(msg, ask)
|
|
||||||
return
|
|
||||||
} else if why != "" {
|
|
||||||
p.refuseAsker(msg, ask, why)
|
p.refuseAsker(msg, ask, why)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user