carlos / platform Public

edge: fresh look only in probeDNS, carried to the pass (#724, R2)

Astra R2 found the per-minute window refilled inside a long pass, a
successful probe could not authorize the pass it triggered, and an
unresolved CNAME AAAA read as "no IPv6". Redesigned narrowly (Paul:
one last, simpler round):

- pass takes no fresh look. probeDNS, which only sees names on the
  first-hour DNS-miss schedule, takes at most 4 per probe (a hard count),
  6 per minute and one per name per 2 min, least recently asked first.
- A fresh "points here" is kept 3 minutes and pass orders on it.
- ResolveAll accepts an empty AAAA only at the name itself; a CNAME
  target with no AAAA in the reply fails the answer.
- newIssuerWarm is the production construction and what the tests
  drive, with fakes under both DNS sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Summary

Fresh look only in probeDNS (4/probe, 6/min, 2-min spacing, LRU order), carried 3 min to pass; AAAA via CNAME fails closed; newIssuerWarm wiring.
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 6ba2dd2374c0cd6c5f3f5739b766afaef3a735f9 parent 7314ee7
8 files changed, +251 −142
  • docs/superpowers/notes/census-proposal-warm-gate-fresh-724.md +2 −2
  • internal/domains/freshdns.go +6 −3
  • internal/domains/freshdns_test.go +17 −0
  • internal/edge/certwarm.go +84 −46
  • internal/edge/certwarm_fresh_test.go +135 −82
  • internal/edge/edge.go +2 −4
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-warm-gate-fresh-724.tsv +4 −4

CI failed — run details

diff --git a/docs/superpowers/notes/census-proposal-warm-gate-fresh-724.md b/docs/superpowers/notes/census-proposal-warm-gate-fresh-724.md
index fc435b0d2..e9c7cb3f7 100644
--- a/docs/superpowers/notes/census-proposal-warm-gate-fresh-724.md
+++ b/docs/superpowers/notes/census-proposal-warm-gate-fresh-724.md
@@ -4,7 +4,7 @@ Ruling `census-ruling-warm-gate-fresh-724`. The independent reviewer approves or
| unit | change | read sites | what changed |
|---|---|---|---|
-| `internal/edge/edge.go` `RunWithActivatorReady` | body | unchanged (5) | the cert warm is built with productionWarmGates: the cached gate as before, plus warm.freshPoints = dnsGate(warmFresh.ResolveAll, edgeIPs), the zone-verified FreshResolver from #724 reading A and AAAA; asked only for names in their first hour of DNS misses, at most 6 per minute and once per name per 2 min; every address must be an edge (#724 follow-up) |
+| `internal/edge/edge.go` `RunWithActivatorReady` | body | unchanged (5) | the cert warm is built with newIssuerWarm: the cached DNS gate as before, plus a fresh gate dnsGate(FreshResolver.ResolveAll) (A+AAAA, zone-verified, every address must be an edge) asked only by probeDNS for names on the first-hour DNS-miss schedule, at most 4 per probe, 6 per minute, once per name per 2 min; a fresh yes lets pass order the name for 3 min (#724 follow-up) |
Envelopes re-pinned: `internal/domains`, `internal/edge`.
@@ -14,6 +14,6 @@ Recorded dispositions, which each change must still satisfy:
- `internal/edge/edge.go` `RunWithActivatorReady`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added
-Seal: `250e3ba91e1bc5fcd6be5cc2bafce4c7d6645d2d2f0c080913b99f01b1d19129` → `2b7779f82efa86d08922bb5cb487b08d20b0142c038e759cbd79b988843bda80`.
+Seal: `250e3ba91e1bc5fcd6be5cc2bafce4c7d6645d2d2f0c080913b99f01b1d19129` → `b3a7fe56329bff5348d60685919ad73ae9dd3536f4d76765ccc93a1cc0e62fbd`.
Overlay: `internal/provision/testdata/plan14-root-reads-warm-gate-fresh-724.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/domains/freshdns.go b/internal/domains/freshdns.go
index 4924a39c2..ec4e63bc5 100644
--- a/internal/domains/freshdns.go
+++ b/internal/domains/freshdns.go
@@ -495,8 +495,10 @@ func (r *FreshResolver) ask(ctx context.Context, server netip.AddrPort, name, zo
// askAll is ask plus the name's AAAA records from the same server, for a
// caller that must see every address a client could be sent to (the cert
// warm's gate: a CA validating over IPv6 against a foreign AAAA fails even
-// when every A record is ours). The AAAA half may be authoritatively empty;
-// any other AAAA failure fails the whole answer. When the A half ended at an
+// when every A record is ours). The AAAA half may be authoritatively empty
+// only at the name itself; a CNAME target the reply gives no AAAA for may
+// sit in a delegated child this server does not answer for, so that, and
+// any other AAAA failure, fails the whole answer. When the A half ended at an
// out-of-zone target, the cached LookupHost already answered for both
// families and nothing more is asked.
func (r *FreshResolver) askAll(ctx context.Context, server netip.AddrPort, name, zone string) ([]string, error) {
@@ -516,7 +518,8 @@ func (r *FreshResolver) askAll(ctx context.Context, server netip.AddrPort, name,
switch {
case err == nil:
return append(v4, v6...), nil
- case errors.Is(err, errNoData), errors.Is(err, errInZoneNoData):
+ case errors.Is(err, errNoData):
+ // The name itself, with no CNAME, has no AAAA: complete evidence.
return v4, nil
case isNotFound(err):
// NXDOMAIN for AAAA right after addresses for A: inconsistent.
diff --git a/internal/domains/freshdns_test.go b/internal/domains/freshdns_test.go
index fc1abcbe3..381bbc372 100644
--- a/internal/domains/freshdns_test.go
+++ b/internal/domains/freshdns_test.go
@@ -600,3 +600,20 @@ func TestFreshResolverResolveAllTakesBothFamiliesFromTheCNAMETarget(t *testing.T
t.Fatalf("ResolveAll = %v, %v; want both families from the target", ips, err)
}
}
+
+// Astra R2 (follow-up) P1: a CNAME target the AAAA reply gives nothing for
+// may sit in a delegated child this server does not answer for, so its
+// IPv6 addresses are unknown: ResolveAll fails rather than reporting A only.
+func TestFreshResolverResolveAllRefusesAnUnresolvedAAAATarget(t *testing.T) {
+ fa := startAuthority(t, "example.com", func(q dnsmessage.Question, r *dnsmessage.Message) bool {
+ r.Authoritative = true
+ r.Answers = []dnsmessage.Resource{cnameRecord("shop.example.com.", "app.sub.example.com.")}
+ if q.Type == dnsmessage.TypeA {
+ r.Answers = append(r.Answers, aRecord("app.sub.example.com.", edgeIP))
+ }
+ return true
+ })
+ if ips, err := oneZone(fa).resolver(clock()).ResolveAll("shop.example.com"); err == nil {
+ t.Fatalf("ResolveAll = %v, want an error: the target's AAAA is unknown", ips)
+ }
+}
diff --git a/internal/edge/certwarm.go b/internal/edge/certwarm.go
index 540987d87..4745c0fe5 100644
--- a/internal/edge/certwarm.go
+++ b/internal/edge/certwarm.go
@@ -79,16 +79,18 @@ const (
warmDNSFastFor = 10 * time.Minute
warmDNSRetrySlow = 5 * time.Minute
warmDNSSlowFor = time.Hour
- // The fresh look's bounds (#724). Only a name in its first
- // warmDNSSlowFor of DNS misses is eligible (the window in which a
- // customer finishes their DNS and the probe schedule is watching);
- // at most warmFreshPerWindow fresh looks per warmCappedDelay across all
- // names, and one per name per warmFreshSpacing so a large batch of new
- // names takes turns. Each look is bounded by the FreshResolver's own
- // timeout, so the warm loop spends at most warmFreshPerWindow of those
- // per minute on it, and nothing on names past their first hour.
+ // The fresh look's bounds (#724). Only probeDNS takes fresh looks, so
+ // only names on the DNS-miss schedule (their first warmDNSSlowFor of
+ // misses) ever get one, and pass never does. One probe takes at most
+ // warmFreshPerProbe, a hard count however long the lookups take; across
+ // probes, at most warmFreshPerWindow per warmCappedDelay and one per name
+ // per warmFreshSpacing. A fresh look that finds the name pointing here
+ // lets pass order it for warmFreshValid, which covers the pass the probe
+ // triggers.
+ warmFreshPerProbe = 4
warmFreshPerWindow = 6
warmFreshSpacing = 2 * time.Minute
+ warmFreshValid = 3 * time.Minute
// warmGateRecheck is how often the loop looks at the issuer gate between
// passes (#386). The gate is the housekeeper lease, held in memory, so a
// look costs nothing; a box that takes the lease over (or takes it BACK
@@ -177,13 +179,17 @@ type certWarm struct {
// freshPoints is the gate's uncached second look (#724): the cached
// resolver can hold a "no such name" for a new customer hostname for
- // the zone's SOA minimum. nil leaves the cached gate alone. It is asked
- // only through freshOpen, which bounds it (see there).
+ // the zone's SOA minimum. nil leaves the cached gate alone. Only
+ // probeDNS asks it, never pass (see probeDNS for the bounds).
freshPoints func(string) bool
// freshSpent stamps the fresh looks in the last warmCappedDelay;
- // freshLast is each name's latest one. Both pruned as they age out.
+ // freshLast is each name's latest one (kept while the name is on the
+ // DNS-miss schedule, so probeDNS can put the least recently asked
+ // first); freshOK is each name a fresh look found pointing here, until
+ // when pass may order it on that evidence.
freshSpent []time.Time
freshLast map[string]time.Time
+ freshOK map[string]time.Time
// wake asks the loop for an early pass (nudge). Buffered one deep: a
// wake already pending covers any that arrive behind it.
@@ -218,6 +224,7 @@ func newCertWarm(hosts func() []string, getCert func(*tls.ClientHelloInfo) (*tls
dnsMisses: map[string]dnsMiss{},
settleUntil: map[string]time.Time{},
freshLast: map[string]time.Time{},
+ freshOK: map[string]time.Time{},
wake: make(chan struct{}, 1),
now: time.Now,
gateTick: warmGateRecheck,
@@ -431,12 +438,29 @@ func (c *certWarm) probeDNS() bool {
due = append(due, h)
}
}
+ // Least recently given a fresh look first (never first of all), so a
+ // large batch of new names takes turns at the per-probe cap.
+ sort.Slice(due, func(i, j int) bool {
+ ti, tj := c.freshLast[due[i]], c.freshLast[due[j]]
+ if !ti.Equal(tj) {
+ return ti.Before(tj)
+ }
+ return due[i] < due[j]
+ })
c.mu.Unlock()
- sort.Strings(due)
- points := false
+ points, fresh := false, 0
for _, h := range due {
- if c.gateOpen(h) {
+ switch {
+ case c.pointsHere(h):
points = true
+ case c.freshPoints != nil && fresh < warmFreshPerProbe && c.freshOpen(h):
+ fresh++
+ if c.freshPoints(h) {
+ c.mu.Lock()
+ c.freshOK[h] = c.now().Add(warmFreshValid)
+ c.mu.Unlock()
+ points = true
+ }
}
c.dnsMissed(h, now)
}
@@ -521,7 +545,7 @@ func (c *certWarm) pass() time.Duration {
c.discharge(h)
continue
}
- if !c.gateOpen(h) {
+ if !c.passGate(h, now) {
// Handed to the DNS-miss schedule.
c.discharge(h)
c.dnsMissed(h, now)
@@ -529,6 +553,8 @@ func (c *certWarm) pass() time.Duration {
}
c.mu.Lock()
delete(c.dnsMisses, h)
+ delete(c.freshOK, h)
+ delete(c.freshLast, h)
// Stamped now, after the DNS lookup and just before the order,
// not with the pass's per-host now: a slow resolver would
// otherwise date the order early and let it leave the window
@@ -580,6 +606,16 @@ func (c *certWarm) pass() time.Duration {
delete(c.dnsMisses, h)
}
}
+ for h, until := range c.freshOK {
+ if !inSet[h] || !c.now().Before(until) {
+ delete(c.freshOK, h)
+ }
+ }
+ for h := range c.freshLast {
+ if _, pending := c.dnsMisses[h]; !pending {
+ delete(c.freshLast, h)
+ }
+ }
c.mu.Unlock()
owed, isOwed := c.owedWait(inSet)
// Housekeeping last: it is the least urgent thing this pass does, and
@@ -767,24 +803,27 @@ func wildcardCoverer(parents func() []string) func(string) bool {
}
}
-// gateOpen is the DNS gate the warm applies before a new order: the cached
-// gate, then, when that says no, the bounded fresh look.
-func (c *certWarm) gateOpen(h string) bool {
+// passGate is the DNS gate pass applies before a new order: the cached
+// gate, or a fresh look by probeDNS that found the name pointing here less
+// than warmFreshValid ago. pass takes no fresh look of its own.
+func (c *certWarm) passGate(h string, now time.Time) bool {
if c.pointsHere(h) {
return true
}
- return c.freshPoints != nil && c.freshOpen(h) && c.freshPoints(h)
+ c.mu.Lock()
+ until, ok := c.freshOK[h]
+ c.mu.Unlock()
+ return ok && now.Before(until)
}
// freshOpen reports whether h may have a fresh look now, and if so spends
-// it. A name qualifies only in its first warmDNSSlowFor of misses (a name
-// not yet on the schedule is on its first); the per-window and per-name
-// bounds are described at warmFreshPerWindow.
+// it: inside the per-window and per-name bounds (warmFreshPerWindow), and
+// only in the name's first warmDNSSlowFor of misses.
func (c *certWarm) freshOpen(h string) bool {
now := c.now()
c.mu.Lock()
defer c.mu.Unlock()
- if m, ok := c.dnsMisses[h]; ok && now.Sub(m.first) >= warmDNSSlowFor {
+ if m, ok := c.dnsMisses[h]; !ok || now.Sub(m.first) >= warmDNSSlowFor {
return false
}
kept := c.freshSpent[:0]
@@ -794,15 +833,10 @@ func (c *certWarm) freshOpen(h string) bool {
}
}
c.freshSpent = kept
- for n, t := range c.freshLast {
- if now.Sub(t) >= warmFreshSpacing {
- delete(c.freshLast, n)
- }
- }
if len(c.freshSpent) >= warmFreshPerWindow {
return false
}
- if _, recent := c.freshLast[h]; recent {
+ if t, ok := c.freshLast[h]; ok && now.Sub(t) < warmFreshSpacing {
return false
}
c.freshSpent = append(c.freshSpent, now)
@@ -810,28 +844,32 @@ func (c *certWarm) freshOpen(h string) bool {
return true
}
-// Production lookups for the warm's two gates, variables so a test can
-// drive productionWarmGates through its real construction.
+// warmCachedLookup and warmFreshResolver are the issuer warm's two DNS
+// sources, variables so a test can drive newIssuerWarm, the production
+// construction, with fakes underneath.
var (
- warmCachedLookup = warmResolver
- warmFreshLookup = warmFresh.ResolveAll
+ warmCachedLookup = warmResolver
+ warmFreshResolver freshAllResolver = &domains.FreshResolver{
+ LookupNS: net.DefaultResolver.LookupNS,
+ LookupHost: net.DefaultResolver.LookupHost,
+ LookupCNAME: net.DefaultResolver.LookupCNAME,
+ }
)
-// productionWarmGates builds the warm's cached gate and its fresh one. Both
-// are dnsGate, so both require EVERY address to be an edge and fail closed
-// on an empty edge set; the fresh one reads both address families
-// (ResolveAll), because a CA validating over IPv6 against a foreign AAAA
-// fails even when every A record is ours.
-func productionWarmGates(edgeIPs func() []string) (cached, fresh func(string) bool) {
- return dnsGate(warmCachedLookup, edgeIPs), dnsGate(warmFreshLookup, edgeIPs)
+// freshAllResolver is the fresh look the warm needs: every address of both
+// families (domains.FreshResolver.ResolveAll), because a CA validating over
+// IPv6 against a foreign AAAA fails even when every A record is ours.
+type freshAllResolver interface {
+ ResolveAll(host string) ([]string, error)
}
-// warmFresh is the fresh gate's resolver (#724), with its own failure
-// backoff.
-var warmFresh = &domains.FreshResolver{
- LookupNS: net.DefaultResolver.LookupNS,
- LookupHost: net.DefaultResolver.LookupHost,
- LookupCNAME: net.DefaultResolver.LookupCNAME,
+// newIssuerWarm is the cert warm as the edge runs it: the cached DNS gate,
+// and the fresh look (#724) through the same dnsGate, so it too requires
+// EVERY address to be an edge and fails closed on an empty edge set.
+func newIssuerWarm(hosts func() []string, getCert func(*tls.ClientHelloInfo) (*tls.Certificate, error), edgeIPs func() []string, issuer IssuerGate, store release.Store) *certWarm {
+ w := newCertWarm(hosts, getCert, dnsGate(warmCachedLookup, edgeIPs), issuer, store)
+ w.freshPoints = dnsGate(warmFreshResolver.ResolveAll, edgeIPs)
+ return w
}
// dnsGate builds the "does this name point at us?" test the warm applies
diff --git a/internal/edge/certwarm_fresh_test.go b/internal/edge/certwarm_fresh_test.go
index dcbaa1d2c..800447370 100644
--- a/internal/edge/certwarm_fresh_test.go
+++ b/internal/edge/certwarm_fresh_test.go
@@ -10,128 +10,181 @@ import (
// #724 follow-up: the issuer's own resolver can hold a "no such name" for a
// new customer hostname (it is also the home box, a single-box deployment,
-// or it looked the name up before the record existed). The warm's gate then
-// takes a fresh look, bounded: names in their first hour of misses only, at
-// most warmFreshPerWindow per window, one per name per warmFreshSpacing.
+// or it looked the name up before the record existed). probeDNS then takes
+// a bounded fresh look, and a fresh "points here" lets the pass it triggers
+// order the name. These tests build the warm with newIssuerWarm, the
+// production construction, with fakes under its two DNS sources.
-func freshWarm(t *testing.T, clock *fakeClock, hosts []string, fresh func(string) bool) (*certWarm, *[]string) {
+type fakeFresh struct {
+ answer []string
+ calls int
+ tick func() // runs inside each lookup (a slow resolver)
+}
+
+func (f *fakeFresh) ResolveAll(string) ([]string, error) {
+ f.calls++
+ if f.tick != nil {
+ f.tick()
+ }
+ return f.answer, nil
+}
+
+// issuerWarm builds the production warm over a cache that always says "no
+// such name" and the given fresh resolver, for hosts, on clock.
+func issuerWarm(t *testing.T, clock *fakeClock, hosts []string, fresh *fakeFresh) (*certWarm, *[]string) {
t.Helper()
+ oldC, oldF := warmCachedLookup, warmFreshResolver
+ t.Cleanup(func() { warmCachedLookup, warmFreshResolver = oldC, oldF })
+ warmCachedLookup = func(string) ([]string, error) {
+ return nil, &net.DNSError{Err: "no such host", IsNotFound: true}
+ }
+ warmFreshResolver = fresh
var ordered []string
- w := newCertWarm(
+ w := newIssuerWarm(
func() []string { return hosts },
func(h *tls.ClientHelloInfo) (*tls.Certificate, error) {
ordered = append(ordered, h.ServerName)
return &tls.Certificate{}, nil
},
- func(string) bool { return false }, // the cache says no, always
+ func() []string { return []string{"203.0.113.7", "2001:db8::7"} },
nil,
nil,
)
w.now = clock.now
- w.freshPoints = fresh
return w, &ordered
}
-func TestWarmOrdersANewNameTheFreshLookSaysPointsHere(t *testing.T) {
+// The whole path: first pass misses (no fresh look in pass), the probe's
+// fresh look finds the name pointing here, and the pass it triggers orders
+// it while the cache still says no.
+func TestIssuerWarmOrdersOnAFreshProbe(t *testing.T) {
clock := &fakeClock{t: time.Unix(1_800_000_000, 0)}
- w, ordered := freshWarm(t, clock, []string{"www.customer.test"}, func(string) bool { return true })
+ fresh := &fakeFresh{answer: []string{"203.0.113.7"}}
+ w, ordered := issuerWarm(t, clock, []string{"www.customer.test"}, fresh)
+ w.pass()
+ if fresh.calls != 0 || len(*ordered) != 0 {
+ t.Fatalf("first pass: fresh calls %d, ordered %v; want none (pass takes no fresh look)", fresh.calls, *ordered)
+ }
+ clock.advance(warmDNSRetryFast)
+ if !w.probeDNS() {
+ t.Fatal("probe: the fresh look did not report the name pointing here")
+ }
w.pass()
- if len(*ordered) != 1 || (*ordered)[0] != "www.customer.test" {
- t.Fatalf("ordered %v, want the new name ordered on its fresh look", *ordered)
+ if len(*ordered) != 1 || fresh.calls != 1 {
+ t.Fatalf("after probe + pass: ordered %v, fresh calls %d; want the name ordered on one fresh look", *ordered, fresh.calls)
}
}
-func TestWarmGivesNoFreshLookPastAnHourOfMisses(t *testing.T) {
+// The fresh evidence is short-lived: a pass after warmFreshValid does not
+// order on it.
+func TestIssuerWarmFreshEvidenceExpires(t *testing.T) {
clock := &fakeClock{t: time.Unix(1_800_000_000, 0)}
- asked := 0
- w, ordered := freshWarm(t, clock, []string{"old.customer.test"}, func(string) bool { asked++; return false })
- w.pass() // first miss: one fresh look
- clock.advance(warmDNSSlowFor + time.Minute)
- w.freshPoints = func(string) bool { asked++; return true }
- before := asked
+ fresh := &fakeFresh{answer: []string{"203.0.113.7"}}
+ w, ordered := issuerWarm(t, clock, []string{"www.customer.test"}, fresh)
w.pass()
- if asked != before || len(*ordered) != 0 {
- t.Fatalf("a name an hour into its misses got a fresh look (asked %d -> %d, ordered %v)", before, asked, *ordered)
+ clock.advance(warmDNSRetryFast)
+ w.probeDNS()
+ clock.advance(warmFreshValid)
+ w.pass()
+ if len(*ordered) != 0 {
+ t.Fatalf("ordered %v on fresh evidence older than warmFreshValid", *ordered)
}
}
-func TestWarmFreshLooksAreBoundedPerWindowAndPerName(t *testing.T) {
+func TestIssuerWarmFreshGateRequiresEveryAddress(t *testing.T) {
+ for name, tc := range map[string]struct {
+ answer []string
+ want int
+ }{
+ "A and AAAA ours": {[]string{"203.0.113.7", "2001:db8::7"}, 1},
+ "A ours, AAAA elsewhere": {[]string{"203.0.113.7", "2001:db8::66"}, 0},
+ "A elsewhere": {[]string{"192.0.2.1"}, 0},
+ "no addresses": {nil, 0},
+ } {
+ clock := &fakeClock{t: time.Unix(1_800_000_000, 0)}
+ w, ordered := issuerWarm(t, clock, []string{"www.customer.test"}, &fakeFresh{answer: tc.answer})
+ w.pass()
+ clock.advance(warmDNSRetryFast)
+ w.probeDNS()
+ w.pass()
+ if len(*ordered) != tc.want {
+ t.Errorf("%s: ordered %v, want %d", name, *ordered, tc.want)
+ }
+ }
+}
+
+// One probe takes at most warmFreshPerProbe fresh looks, however long they
+// take, and the next probe goes to names that have not had a turn.
+func TestIssuerWarmFreshLooksAreCappedPerProbeAndTakeTurns(t *testing.T) {
clock := &fakeClock{t: time.Unix(1_800_000_000, 0)}
var hosts []string
for i := 0; i < 20; i++ {
hosts = append(hosts, fmt.Sprintf("n%02d.customer.test", i))
}
- asked := map[string]int{}
- w, _ := freshWarm(t, clock, hosts, func(h string) bool { asked[h]++; return false })
- w.pass()
- total := 0
- for _, n := range asked {
- total += n
- }
- if total != warmFreshPerWindow {
- t.Fatalf("fresh looks in one window = %d, want %d", total, warmFreshPerWindow)
- }
- // Inside the per-name spacing the same names are not asked again, so
- // the next window goes to names that have not had a turn.
- clock.advance(warmCappedDelay)
+ fresh := &fakeFresh{}
+ fresh.tick = func() { clock.advance(4 * time.Second) } // a slow resolver
+ w, _ := issuerWarm(t, clock, hosts, fresh)
w.pass()
- for h, n := range asked {
- if n > 1 {
- t.Fatalf("%s asked %d times inside warmFreshSpacing", h, n)
+ asked := map[string]int{}
+ for probe := 0; probe < 5; probe++ {
+ clock.advance(warmDNSRetryFast)
+ before := fresh.calls
+ w.mu.Lock()
+ last := map[string]time.Time{}
+ for h, t := range w.freshLast {
+ last[h] = t
}
+ w.mu.Unlock()
+ w.probeDNS()
+ if got := fresh.calls - before; got > warmFreshPerProbe {
+ t.Fatalf("probe %d took %d fresh looks, cap %d", probe, got, warmFreshPerProbe)
+ }
+ w.mu.Lock()
+ for h, t := range w.freshLast {
+ if !t.Equal(last[h]) {
+ asked[h]++
+ }
+ }
+ w.mu.Unlock()
}
- if len(asked) != 2*warmFreshPerWindow {
- t.Fatalf("names asked after two windows = %d, want %d", len(asked), 2*warmFreshPerWindow)
+ if len(asked) != 20 {
+ t.Fatalf("names given a fresh look over five probes = %d, want all 20 (turns)", len(asked))
}
}
-// The production gates: both require every address to be an edge, the
-// fresh one reads both families, and an empty edge set asks nobody.
-func TestProductionWarmGates(t *testing.T) {
- oldC, oldF := warmCachedLookup, warmFreshLookup
- defer func() { warmCachedLookup, warmFreshLookup = oldC, oldF }()
- cachedCalls, freshCalls := 0, 0
- var freshAnswer []string
- warmCachedLookup = func(string) ([]string, error) {
- cachedCalls++
- return nil, &net.DNSError{Err: "no such host", IsNotFound: true}
+// Names past their first hour of misses are not on the probe schedule and
+// pass takes no fresh look, so an abandoned name costs no fresh lookups.
+func TestIssuerWarmGivesAbandonedNamesNoFreshLook(t *testing.T) {
+ clock := &fakeClock{t: time.Unix(1_800_000_000, 0)}
+ fresh := &fakeFresh{}
+ w, _ := issuerWarm(t, clock, []string{"old.customer.test"}, fresh)
+ w.pass()
+ for i := 0; i < 20; i++ {
+ clock.advance(warmDNSRetrySlow)
+ w.probeDNS()
}
- warmFreshLookup = func(string) ([]string, error) { freshCalls++; return freshAnswer, nil }
-
- edges := []string{"203.0.113.7", "2001:db8::7"}
- cached, fresh := productionWarmGates(func() []string { return edges })
- for name, tc := range map[string]struct {
- answer []string
- want bool
- }{
- "A ours": {[]string{"203.0.113.7"}, true},
- "A and AAAA ours": {[]string{"203.0.113.7", "2001:db8::7"}, true},
- "A ours, AAAA elsewhere": {[]string{"203.0.113.7", "2001:db8::66"}, false},
- "A elsewhere": {[]string{"192.0.2.1"}, false},
- "no addresses": {nil, false},
- } {
- freshAnswer = tc.answer
- if cached("www.customer.test") {
- t.Fatalf("%s: the cached gate opened on NXDOMAIN", name)
- }
- if got := fresh("www.customer.test"); got != tc.want {
- t.Errorf("%s: fresh gate = %v, want %v", name, got, tc.want)
- }
+ before := fresh.calls
+ clock.advance(warmInterval)
+ w.probeDNS()
+ w.pass()
+ if fresh.calls != before {
+ t.Fatalf("a name past its first hour got %d more fresh looks", fresh.calls-before)
}
+}
- edges = nil
- cachedCalls, freshCalls = 0, 0
- cached, fresh = productionWarmGates(func() []string { return edges })
- if cached("www.customer.test") || fresh("www.customer.test") {
+// An empty edge set fails closed before either source is asked.
+func TestIssuerWarmEmptyEdgeSetAsksNobody(t *testing.T) {
+ oldC, oldF := warmCachedLookup, warmFreshResolver
+ defer func() { warmCachedLookup, warmFreshResolver = oldC, oldF }()
+ cached := 0
+ warmCachedLookup = func(string) ([]string, error) { cached++; return []string{"203.0.113.7"}, nil }
+ fresh := &fakeFresh{answer: []string{"203.0.113.7"}}
+ warmFreshResolver = fresh
+ w := newIssuerWarm(func() []string { return nil }, nil, func() []string { return nil }, nil, nil)
+ if w.pointsHere("www.customer.test") || w.freshPoints("www.customer.test") {
t.Fatal("an empty edge set opened a gate")
}
- if cachedCalls != 0 || freshCalls != 0 {
- t.Fatalf("an empty edge set still looked names up (cached %d, fresh %d)", cachedCalls, freshCalls)
- }
-}
-
-func TestProductionWarmGatesUseTheFreshResolver(t *testing.T) {
- if warmFresh.LookupNS == nil || warmFresh.LookupHost == nil || warmFresh.LookupCNAME == nil {
- t.Fatal("warmFresh is not wired to the system resolver")
+ if cached != 0 || fresh.calls != 0 {
+ t.Fatalf("an empty edge set still looked names up (cached %d, fresh %d)", cached, fresh.calls)
}
}
diff --git a/internal/edge/edge.go b/internal/edge/edge.go
index 653ee7c45..69d32bd28 100644
--- a/internal/edge/edge.go
+++ b/internal/edge/edge.go
@@ -4900,15 +4900,13 @@ func RunWithActivatorReady(args []string, act Activator, cache *Cache, ready fun
defer cancel()
return edgesfile.EdgeIPs(ctx, store, envIPs, time.Now())
}
- cachedGate, freshGate := productionWarmGates(edgeIPs)
- warm := newCertWarm(
+ warm := newIssuerWarm(
func() []string { return e.warmSet(appsDomain, parents) },
perHostCert,
- cachedGate,
+ edgeIPs,
e.issuerGate,
store,
)
- warm.freshPoints = freshGate
// Woken when its set may have grown (#386), so a custom domain is
// ordered seconds after it reaches this box rather than at the next
// hourly pass: a local route reload, or a change in the names other
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 7f85d7482..374072473 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -140,4 +140,4 @@ plan14-root-reads-gvisor-update-dirs.tsv 1f1b2fdb569b7be42e75e10d1943d7e51270829
plan14-root-reads-region-ha-held-build.tsv beb085e4c6cdb3d430d12a8dc3c93f25cc3faf1aa7d62be37698ff9c9c82ecce
plan14-root-reads-fixedbox-health-alarms.tsv 0f7153571df8c1b4b50c31f57efcfdf60c71a12c80fd935fb3ea202fa0201dd5
plan14-root-reads-fixed-host-ignore-user-data.tsv 250e3ba91e1bc5fcd6be5cc2bafce4c7d6645d2d2f0c080913b99f01b1d19129
-plan14-root-reads-warm-gate-fresh-724.tsv 2b7779f82efa86d08922bb5cb487b08d20b0142c038e759cbd79b988843bda80
+plan14-root-reads-warm-gate-fresh-724.tsv b3a7fe56329bff5348d60685919ad73ae9dd3536f4d76765ccc93a1cc0e62fbd
diff --git a/internal/provision/testdata/plan14-root-reads-warm-gate-fresh-724.tsv b/internal/provision/testdata/plan14-root-reads-warm-gate-fresh-724.tsv
index be5453c07..503e8b815 100644
--- a/internal/provision/testdata/plan14-root-reads-warm-gate-fresh-724.tsv
+++ b/internal/provision/testdata/plan14-root-reads-warm-gate-fresh-724.tsv
@@ -1,6 +1,6 @@
# Census overlay warm-gate-fresh-724, written by census-propose (#369). census-ruling-warm-gate-fresh-724, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-warm-gate-fresh-724.md.
# 1 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-@legacy ca90c6ae379642ec4940b045ce0503bf077c3ac77354821ccfa0b1b86bc3f182 internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-gate-fresh-724;basis=the cert warm is built with productionWarmGates: the cached gate as before, plus warm.freshPoints = dnsGate(warmFresh.ResolveAll, edgeIPs), the zone-verified FreshResolver from #724 reading A and AAAA; asked only for names in their first hour of DNS misses, at most 6 per minute and once per name per 2 min; every address must be an edge (#724 follow-up) data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 d323759abc16baa4909e732ae92b61115d1864d69561ecd12708fbbbbd8e8fea
-internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-gate-fresh-724;basis=the cert warm is built with productionWarmGates: the cached gate as before, plus warm.freshPoints = dnsGate(warmFresh.ResolveAll, edgeIPs), the zone-verified FreshResolver from #724 reading A and AAAA; asked only for names in their first hour of DNS misses, at most 6 per minute and once per name per 2 min; every address must be an edge (#724 follow-up) data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 d323759abc16baa4909e732ae92b61115d1864d69561ecd12708fbbbbd8e8fea
-@coverage internal/domains e6853d3554575f7ef64ba67bff7778ad779314041f0128e1dba0f8b12a3701a6
-@coverage internal/edge 436af1c9284505769f969d10c2e31babf624ce054683e394e983e5031e2b17c7
+@legacy 2b7b55a51ef55eaaec35d915f49a4e7da03845143d5f6b4da7daf54ee8575947 internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-gate-fresh-724;basis=the cert warm is built with newIssuerWarm: the cached DNS gate as before, plus a fresh gate dnsGate(FreshResolver.ResolveAll) (A+AAAA, zone-verified, every address must be an edge) asked only by probeDNS for names on the first-hour DNS-miss schedule, at most 4 per probe, 6 per minute, once per name per 2 min; a fresh yes lets pass order the name for 3 min (#724 follow-up) data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 2cade75b3861ac808925bb7b3cef86bfe5e3a58323f53344776b719bff3f1cd4
+internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-gate-fresh-724;basis=the cert warm is built with newIssuerWarm: the cached DNS gate as before, plus a fresh gate dnsGate(FreshResolver.ResolveAll) (A+AAAA, zone-verified, every address must be an edge) asked only by probeDNS for names on the first-hour DNS-miss schedule, at most 4 per probe, 6 per minute, once per name per 2 min; a fresh yes lets pass order the name for 3 min (#724 follow-up) data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 2cade75b3861ac808925bb7b3cef86bfe5e3a58323f53344776b719bff3f1cd4
+@coverage internal/domains 3eede923c141fe5265156f4ad6c9b718238db5d0d1931d5357ad354b7f2507e2
+@coverage internal/edge a7c161823c9c24ed7a8c93d1ee9cc7d54231e62a4fdf9058cbaee4c2ca646608