selfcompose: the one place says its source at every caller, reads the have's build, answers HoldsData; the tool composition reads it outside the agent's lock (A-484, A-482)
Builds: design 47 G A-484, A-484a, A-482
This commit is contained in:
@@ -413,6 +413,9 @@ func (c *Composer) layModules() {
|
||||
// layAnswer lays a module from the manifest the one place read of the build it runs (A-484): the entry's own fields, or the
|
||||
// trunk's answer, which holds none of an entry's checks.
|
||||
layAnswer := func(module string, a runningAnswer) bool {
|
||||
if a.Said != "" {
|
||||
said = append(said, a.Said)
|
||||
}
|
||||
switch {
|
||||
case !a.Known:
|
||||
return false
|
||||
@@ -479,17 +482,15 @@ func (c *Composer) layModules() {
|
||||
}
|
||||
// Running here with no entry of its wanted build and none of the newest: it stands, for resolution alone, as the manifest of
|
||||
// the build it runs, from the one place (A-484), so the module that requires what it provides is no "nothing provides";
|
||||
// its want stays held. A running build whose entry is held is laid where it is heard (above) and is read by a held module's offer
|
||||
// through the one place alone, so it is not laid again here.
|
||||
// its want stays held. An answer from the entry of the running build is not laid here: that entry is laid where its module is heard
|
||||
// (above), and laying it for a module that is not (heard nowhere yet, its want moving) made the node compose and apply the move twice
|
||||
// (TestNatsTheBusServerIsTakenOver..., one run in five); a held module's offer reads that entry through the one place alone.
|
||||
if _, laid := modules[module]; !laid && c.countsAsRunning(module) {
|
||||
if a := c.runningLocked(running, c.env.Node, module, ""); a.Source != SourceEntry && layAnswer(module, a) {
|
||||
m := modules[module]
|
||||
m.Fp2 = w.Fp
|
||||
modules[module] = m
|
||||
said = append(said, fmt.Sprintf("%s runs a build whose entry the node does not hold, so it counts the manifest read from %s; its want stays held", module, a.Source))
|
||||
if a.Said != "" {
|
||||
said = append(said, a.Said)
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
@@ -562,6 +563,7 @@ func (c *Composer) needsAddressOf(node, module string) bool {
|
||||
func (c *Composer) askTrunkBuilds() (wait func()) {
|
||||
type ask struct{ node, module, running string }
|
||||
var asks []ask
|
||||
var sayLines []string
|
||||
var running []engcomp.Composed
|
||||
if c.env.Running != nil {
|
||||
running = c.env.Running()
|
||||
@@ -582,7 +584,11 @@ func (c *Composer) askTrunkBuilds() (wait func()) {
|
||||
} else if !c.needsAddressOf(node, module) || !c.lacksEntry(node, module) {
|
||||
continue
|
||||
}
|
||||
if a := c.runningLocked(running, node, module, ""); a.NeedTrunk {
|
||||
a := c.runningLocked(running, node, module, "")
|
||||
if a.Said != "" {
|
||||
sayLines = append(sayLines, a.Said)
|
||||
}
|
||||
if a.NeedTrunk {
|
||||
if had, asked := c.trunkBuilds[module]; !asked || had.running != a.RunFP {
|
||||
asks = append(asks, ask{node, module, a.RunFP})
|
||||
if c.trunkAsking == nil {
|
||||
@@ -594,6 +600,9 @@ func (c *Composer) askTrunkBuilds() (wait func()) {
|
||||
}
|
||||
}
|
||||
c.mu.Unlock()
|
||||
for _, line := range sayLines {
|
||||
c.sayOnceEach(line)
|
||||
}
|
||||
// Asked beside the pass, a few at a time: no pass waits on the catalog half's answer, and a module that waits for it is only
|
||||
// the one needing that address (A-461e). An answer asks a pass.
|
||||
var all sync.WaitGroup
|
||||
|
||||
Reference in New Issue
Block a user