Retire the kept read though mesh-wireguard has no fingerprint, since the node's own composes it from the manifest the mesh provides (issue 774)
The review of d5e8458 found that mesh-wireguard, provided by the mesh and never wanted at a fingerprint, kept the kept
declaration read on every node for ever, against ADR 0550 §2 once the lease is written. A selfcompose row shows the
node's own composes it from delivery.ProvidedManifest with nothing running, so the kept read holds nothing of it.
Quick fix: name mesh-wireguard in allHave. Thorough fix: allHave counts every module delivery.ProvidedByMesh says the
mesh provides as covered. Chose thorough: one list of provided modules, mesh-sdk's.
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"git.novox.be/novox/mesh-sdk/go/compose"
|
||||
"git.novox.be/novox/mesh-sdk/go/compose/frombus"
|
||||
"git.novox.be/novox/mesh-sdk/go/delivery"
|
||||
"git.novox.be/novox/mesh-sdk/go/overlay"
|
||||
"github.com/nats-io/nats.go"
|
||||
|
||||
"github.com/novox/mesh-host/internal/agent"
|
||||
@@ -398,6 +399,27 @@ func TestTheNodeComposesItsWantsFromTheBus(t *testing.T) {
|
||||
if len(*told4) != 1 || !strings.HasPrefix((*told4)[0], "held power: ") || !strings.Contains((*told4)[0], `"shows" is none of them`) {
|
||||
t.Errorf("the agent was told %q, want power held alone, naming its item", *told4)
|
||||
}
|
||||
// Review of issue 774 (the kept read): mesh-wireguard, which the mesh provides and which never has a fingerprint, is
|
||||
// folded in the node's own and composed from the manifest mesh-sdk provides (delivery.ProvidedManifest), not from
|
||||
// what runs nor the kept declaration: with nothing running (the kept read retired, Running empty) the node's own
|
||||
// still carries its resources, so retiring the read removes nothing of it.
|
||||
c5, told5 := fresh(env.Get)
|
||||
p5 := c5.placements["n1"]
|
||||
p5.Modules = append(append([]delivery.PlacedModule{}, p5.Modules...), delivery.PlacedModule{Module: overlay.Name})
|
||||
p5.Decided.Endpoint = "n1.example:51820"
|
||||
c5.placements["n1"] = p5
|
||||
c5.inOwn[overlay.Name] = true
|
||||
nodeKey5, _ := delivery.ComposedNodeKey("n1")
|
||||
var own5 string
|
||||
for _, u := range c5.compose(ctx) {
|
||||
if u.Key == nodeKey5 {
|
||||
own5 = string(u.Value)
|
||||
}
|
||||
}
|
||||
if len(*told5) != 0 || !strings.Contains(own5, overlay.Name+".") {
|
||||
t.Errorf("the node's own with %s folded and nothing running: told %q, carries %s: %.300s", overlay.Name, *told5,
|
||||
overlay.Name, own5)
|
||||
}
|
||||
|
||||
// A read the bus did not answer, timed out or not, is tried again later; the run's own end and a refusal are not.
|
||||
if !BusFailed(fmt.Errorf("the revisions of it2.mailer.domain: %w", context.DeadlineExceeded)) || !BusFailed(fmt.Errorf("x: %w", nats.ErrNoResponders)) ||
|
||||
|
||||
Reference in New Issue
Block a user