process, stdio: a kept call paces on a stopping tool runner; the ask's bound is a setting (H-A-549)
Review round 1: the process caller read only a reply's error, so a kept call (CallKept, e.g. seat:git.trees) ended at once on stopping instead of pacing until the new runner answers. requestAsk now reads error-kind stopping as busretry.Stopping, which busretry.Fault counts as a transport fault, as away. The Go stdio Ask's 60 s bound becomes the setting ask-bound (default 60 s), read by the settings reader. Builds: design 47 H2 H-A-542, H-A-549
This commit is contained in:
@@ -142,20 +142,25 @@ func TestACallIsAskedAgainOnlyWhenItReachedNoOne(t *testing.T) {
|
||||
t.Errorf("%s: asked %d times (%v), want %d", row.name, asks, err, row.asks)
|
||||
}
|
||||
}
|
||||
// Design 47 H2 §776: a holder's answer of the kind away is a transport fault, called again at the pace; a refusal
|
||||
// of another kind is the caller's answer at once.
|
||||
// Design 47 H2 §776: a holder's answer of the kind away is a transport fault, called again at the pace; so is a
|
||||
// stopping tool runner's reply of the kind stopping (H-A-542, H-A-549); a refusal of another kind is the caller's
|
||||
// answer at once.
|
||||
for _, row := range []struct {
|
||||
name string
|
||||
answers []string
|
||||
asks int
|
||||
}{
|
||||
{"away, then answered", []string{`{"error":"x","error-kind":"away","part":"the forge's store","words":"401"}`, `{"merged":true}`}, 2},
|
||||
{"stopping, then answered by the new runner", []string{"stopping", `{"merged":true}`}, 2},
|
||||
{"refused: answered at once", []string{`{"error":"no","error-kind":"refused"}`}, 1},
|
||||
} {
|
||||
asks := 0
|
||||
request := func(string, []byte) (json.RawMessage, error) {
|
||||
a := row.answers[min(asks, len(row.answers)-1)]
|
||||
asks++
|
||||
if a == "stopping" {
|
||||
return nil, replyError("git's trees was not taken: the tool runner is stopping", "stopping")
|
||||
}
|
||||
return json.RawMessage(a), nil
|
||||
}
|
||||
got, err := callKeptWith(busretry.Kept{Seat: "git", Verb: "merge-pull"}, request, "called", "fallback", nil)
|
||||
|
||||
Reference in New Issue
Block a user