Selfcompose, compose: the trunk build stands where a placement names none; the fallback is another node's only; only the store listen refusal holds fetchers (A-461b)
Builds: design 47 G A-461b
This commit is contained in:
@@ -98,9 +98,14 @@ func (c *composer) places(nodeName string, resolved Resolved) (Placed, error) {
|
||||
// Where no address is known (the holder opens no listen to the mesh, or two), only the modules that fetch from the store
|
||||
// wait, with the words of an unanswered requirement; the node composes the rest (design 47 G A-461, A-452).
|
||||
store, err := c.artifactStoreAddress(nodeName)
|
||||
if err != nil {
|
||||
var noAddress *storeListenError
|
||||
if errors.As(err, &noAddress) {
|
||||
// Only the store holder's listen refusal holds its fetchers; any other error still refuses the node (A-461b).
|
||||
out.storeHeld = modulesNeedingTheStore(plan.Modules, err)
|
||||
store = ""
|
||||
store, err = "", nil
|
||||
}
|
||||
if err != nil {
|
||||
return out, err
|
||||
}
|
||||
r.ArtifactStore = store
|
||||
r.Built = make(map[string]bool, len(c.in.Built))
|
||||
@@ -392,6 +397,11 @@ func (c *composer) storeHolders() map[string]catalogue.Manifest {
|
||||
return out
|
||||
}
|
||||
|
||||
// storeListenError is the refusal of a holder that opens no listen to the mesh, or two: the store has no address (A-461).
|
||||
type storeListenError struct{ said string }
|
||||
|
||||
func (e *storeListenError) Error() string { return e.said }
|
||||
|
||||
// storeListen is the store holder's listen every machine pulls from: its one listen open to the mesh. A holder opening
|
||||
// none, or more than one, says no address, by name: which of two ports is the store is no guess the composer makes.
|
||||
func storeListen(m catalogue.Manifest) (catalogue.Listening, error) {
|
||||
@@ -405,15 +415,15 @@ func storeListen(m catalogue.Manifest) (catalogue.Listening, error) {
|
||||
case 1:
|
||||
return open[0], nil
|
||||
case 0:
|
||||
return catalogue.Listening{}, fmt.Errorf("%s holds %s and opens no tcp listen to the mesh: the artifact store has no "+
|
||||
"address (novox/hq ADR 0632 §1)", m.Module, StoreSeat)
|
||||
return catalogue.Listening{}, &storeListenError{fmt.Sprintf("%s holds %s and opens no tcp listen to the mesh: the artifact store has no "+
|
||||
"address (novox/hq ADR 0632 §1)", m.Module, StoreSeat)}
|
||||
}
|
||||
var said []string
|
||||
for _, l := range open {
|
||||
said = append(said, fmt.Sprintf("%s (%d)", l.Name, l.Port))
|
||||
}
|
||||
return catalogue.Listening{}, fmt.Errorf("%s holds %s and opens %s to the mesh: the artifact store's address is its one "+
|
||||
"listen open to the mesh (novox/hq ADR 0632 §1)", m.Module, StoreSeat, strings.Join(said, ", "))
|
||||
return catalogue.Listening{}, &storeListenError{fmt.Sprintf("%s holds %s and opens %s to the mesh: the artifact store's address is its one "+
|
||||
"listen open to the mesh (novox/hq ADR 0632 §1)", m.Module, StoreSeat, strings.Join(said, ", "))}
|
||||
}
|
||||
|
||||
// artifactStoreOnNetwork is the machine on this network that holds the store's seat, and the port that machine put the
|
||||
|
||||
Reference in New Issue
Block a user