C3: the engine-reads keeper keeps the fallback or the last statement at the first fault while the kept call asks on (issue 1966, ADR 0668 §3; review round 1, finding 1)
A part whose node answers nothing waited out busretry.Bound (30 s) before it acted on the node's record: Once asks the verb once, and its fault is taken at once. Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -221,6 +221,10 @@ func NodeOf(subject string, data []byte) (string, bool, error) {
|
||||
type Keeper struct {
|
||||
// Call asks the verb; nil asks nothing (every node then reads as the fallback or the baseline).
|
||||
Call Caller
|
||||
// Once asks the verb once (process.Conn.CallOn). When set, its fault keeps the fallback or the last statement at once,
|
||||
// marked as not answering, while Call, the kept call, asks on until answered (novox/hq ADR 0668 §3): a part does not
|
||||
// wait out busretry.Bound for a node whose engine answers nothing before it acts on what it last knew.
|
||||
Once Caller
|
||||
// Fallback reads a node's record `<node>.node` once where its engine did not answer the verb; nil reads none.
|
||||
Fallback func(node string) ([]string, bool)
|
||||
// Put writes a node's key of the part's state, Delete removes it; nil keeps the statements in memory only.
|
||||
@@ -292,10 +296,25 @@ func (k *Keeper) ask(node, why string) {
|
||||
delete(k.asking, node)
|
||||
k.mu.Unlock()
|
||||
}()
|
||||
if k.Call != nil && k.Once != nil {
|
||||
first := Ask(k.Once, node, k.now())
|
||||
if first.Answered {
|
||||
k.take(first)
|
||||
return
|
||||
}
|
||||
k.settle(first, why)
|
||||
why += "; the kept call asks on after: " + first.Words
|
||||
}
|
||||
s := Statement{Node: node, AskedAt: k.now().UTC(), From: FromNone, Words: "nothing asks the verb"}
|
||||
if k.Call != nil {
|
||||
s = Ask(k.Call, node, k.now())
|
||||
}
|
||||
k.settle(s, why)
|
||||
}
|
||||
|
||||
// settle takes s, read from the node's record in its place where the engine did not answer.
|
||||
func (k *Keeper) settle(s Statement, why string) {
|
||||
node := s.Node
|
||||
if s.From != FromVerb && k.Fallback != nil {
|
||||
if reads, ok := k.Fallback(node); ok {
|
||||
s.ManifestReads, s.From = slices.Clone(reads), FromRecord
|
||||
|
||||
Reference in New Issue
Block a user