The checker waits its compose answer bound, not the SDK's 30 s, for the machines' compositions #144
@@ -174,6 +174,7 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
holdCallsFor(answerBound)
|
||||
verdicts := &manifestVerdicts{}
|
||||
compositions := check.EngineCompositions{
|
||||
Asker: engineAsks{call: caller.CallOn},
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"git.novox.be/novox/mesh-sdk/go/delivery"
|
||||
"git.novox.be/novox/mesh-sdk/go/process"
|
||||
)
|
||||
|
||||
// The checker's own settings (its config, written by the node-engine into ${dir:state}/settings.json, named to the
|
||||
@@ -42,3 +43,12 @@ func composeAnswerBound(path string) (time.Duration, error) {
|
||||
}
|
||||
return time.Duration(*s.Bound) * time.Second, nil
|
||||
}
|
||||
|
||||
// holdCallsFor makes a bus call wait the compose-answer-bound (novox/hq ADR 0593 §7), not the SDK's CallTimeout of 30 s:
|
||||
// the request of Conn.CallOn gives up at CallTimeout, so a node-engine answering at 30.4 s was lost before the bound
|
||||
// applied (issue 1126). It only ever lengthens the SDK's bound, and it is set once, before the first call.
|
||||
func holdCallsFor(bound time.Duration) {
|
||||
if bound > process.CallTimeout {
|
||||
process.CallTimeout = bound
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"git.novox.be/novox/mesh-sdk/go/delivery"
|
||||
"git.novox.be/novox/mesh-sdk/go/process"
|
||||
)
|
||||
|
||||
// ADR 0593 §7: the answer bound is the checker's setting compose-answer-bound, 60 s when the file or the value is
|
||||
@@ -31,5 +32,15 @@ func TestTheAnswerBoundIsTheCheckersSetting(t *testing.T) {
|
||||
if (err != nil) != row.err || got != row.want {
|
||||
t.Errorf("%q: %s, %v", row.body, got, err)
|
||||
}
|
||||
// Issue 1126: the SDK's call gives up at CallTimeout (30 s), so the checker's calls must wait the bound read
|
||||
// (an answer at 31 s is heard under 60 s), and the bound never shortens the SDK's own.
|
||||
if err == nil {
|
||||
was := process.CallTimeout
|
||||
holdCallsFor(got)
|
||||
if process.CallTimeout < got || process.CallTimeout < was {
|
||||
t.Errorf("%q: calls wait %v under bound %v", row.body, process.CallTimeout, got)
|
||||
}
|
||||
process.CallTimeout = was
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user