Node agent: say what it holds today in its answer, so a seed that holds the same is the same; pin mesh-sdk b03bf4c (issue 1126)
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"slices"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -100,6 +101,9 @@ type Composer struct {
|
||||
sealedOwn map[string]ownSealed
|
||||
said string
|
||||
refusal string
|
||||
// held is what the composer's last pass held: each module refused alone, and the node's own ("node") when it could
|
||||
// compose none (heldNow).
|
||||
held []string
|
||||
// doing is what the composer waits on now (waiting), for a running answer to say (issue 1126, T2); its own lock, so
|
||||
// it is read while c.mu is held.
|
||||
doingMu sync.Mutex
|
||||
@@ -621,12 +625,23 @@ func (c *Composer) refused(why string, held map[string]string) {
|
||||
c.mu.Lock()
|
||||
same := c.refusal == said
|
||||
c.refusal = said
|
||||
c.held = heldModules(held)
|
||||
if why != "" {
|
||||
c.held = append(c.held, delivery.HaveNodeWord)
|
||||
}
|
||||
c.mu.Unlock()
|
||||
if !same && c.env.Refused != nil {
|
||||
c.env.Refused(why, held)
|
||||
}
|
||||
}
|
||||
|
||||
// heldNow is what the composer's last pass held, sorted.
|
||||
func (c *Composer) heldNow() []string {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
return slices.Clone(c.held)
|
||||
}
|
||||
|
||||
// keepRunning is comp with each sealed value the node already runs at the same slot kept, where it opens to the same
|
||||
// value (delivery.KeepSeals, issue 1126, C1): of what runs (running, the agent's), else of what its module's have says
|
||||
// it runs (Held). A have written before slots names no slot: its boxes are reused within their own module alone, at a
|
||||
|
||||
Reference in New Issue
Block a user