H-A-335: a held module's share of a holder's words is what runs
The reads runtime on ace restarted twice in two minutes because its MESH_SECRET_PLACES changed: the holders of node-reads and node-files were told the node's secret places and owned paths from held modules' stubs, which differ pass by pass while a part is withheld. While a module is held, the resolution now takes its share from each runtime process as it runs: the secret places are those the modules not held compose merged with every place that runs, and the owned paths keep each running entry a held module owns. Two passes with the same held set compose every runtime process the same; a module that answered and changed is still composed from its build. Builds: design 47 H H-A-335, H-A-337, H-A-306 (2), (3)
This commit is contained in:
@@ -176,10 +176,10 @@ func ComposeIn(in Input, node string, mode Mode) (Declared, []string, error) {
|
||||
// none (resolution.NoStoreError, whatever the shape: an image, a source, a tools bundle, a runtime program, a templates
|
||||
// archive) is left out of the declaration with its words and the rest composes again; the node is never refused whole for it
|
||||
// (design 47 G A-461, A-452). The rendering returned carries the modules so left out, for the filter and the rest to read.
|
||||
func composeWithoutStoreFetchers(plan catalogue.Resolution, with catalogue.Rendering) (catalogue.Composed, catalogue.Rendering, map[string]string, error) {
|
||||
func composeWithoutStoreFetchers(plan catalogue.Resolution, with catalogue.Rendering, holding resolution.Holding) (catalogue.Composed, catalogue.Rendering, map[string]string, error) {
|
||||
var held map[string]string
|
||||
for {
|
||||
composed, err := resolution.Compose(plan, with)
|
||||
composed, err := resolution.ComposeHolding(plan, with, holding)
|
||||
var none *resolution.NoStoreError
|
||||
if !errors.As(err, &none) {
|
||||
return composed, with, held, err
|
||||
@@ -217,7 +217,13 @@ func (c *composer) declaration(nodeName string, mode Mode) (Declared, error) {
|
||||
with := rendered.Rendering
|
||||
with.Generators = gens
|
||||
plan := resolved.Plan
|
||||
composed, with, storeHeld, err := composeWithoutStoreFetchers(plan, with)
|
||||
node, err := c.in.node(nodeName)
|
||||
if err != nil {
|
||||
return Declared{}, err
|
||||
}
|
||||
// A held module's share of a holder's words is what runs of each runtime process (design 47 H, H-A-335, H-A-337).
|
||||
holding := resolution.Holding{Held: node.Held, Runs: node.RunsRuntimes}
|
||||
composed, with, storeHeld, err := composeWithoutStoreFetchers(plan, with, holding)
|
||||
if err != nil {
|
||||
return Declared{}, err
|
||||
}
|
||||
@@ -227,10 +233,6 @@ func (c *composer) declaration(nodeName string, mode Mode) (Declared, error) {
|
||||
if err != nil {
|
||||
return Declared{}, err
|
||||
}
|
||||
node, err := c.in.node(nodeName)
|
||||
if err != nil {
|
||||
return Declared{}, err
|
||||
}
|
||||
// A module that fetches from a store no node reaches is held with its words, as a module whose claim cannot be held is: it
|
||||
// stays on the build it runs, its composition kept (A-452, A-461).
|
||||
held := resolved.Held
|
||||
|
||||
Reference in New Issue
Block a user