carlos / platform Public

certwarm-wake

New custom domains waited up to an hour for a certificate on a multi-edge deployment (#386). Only the issuer box orders, steering keeps visitors on the other boxes, and the per-host cert warm slept a fixed hour between passes. On the flagship, carlos.international waited from 19:24 to 19:54 UTC on 2026-10-24.

What changes (internal/edge/certwarm.go, edge.go, homemap.go):

  • Wake. The warm runs a pass when its set gains a host it has never seen. Wakes come from Edge.OnReload (now additive, so the wildcard manager keeps its hook) and a new homeMap.setServedWake (names homed on other boxes). A wake with nothing new, on a non-issuer, or within a minute of the next pass anyway is dropped.
  • DNS-only probe. A new host whose DNS does not point here yet is re-checked on its own schedule: every minute for 10 minutes, every 5 until an hour, then hourly. The probe reads no outcome records; a full pass runs only once the host points here.
  • Order budget. At most 10 new orders per rolling minute across all passes (it was 10 per pass), so wakes cannot spend the shared ACME account faster.
  • Gate tick. The loop reads the in-memory issuer lease every minute on an absolute deadline and runs a pass when the lease arrives, so a failover or a refused wake does not wait for the hourly pass.
  • Edge set reuse. The DNS gate reuses the deployment's edge set for 5 minutes (30 s for an empty read) instead of re-reading every box's snapshot and edges file per host.

Request budget: no new polling. Between passes: DNS lookups only, plus at most one edge-set read per 5 minutes while a host is pending. A woken pass costs what an hourly pass costs.

Status: Astra review, five rounds, VERDICT: ACCEPT at b5b12cea. Census approved on #280. Merged with main at 41cca5e3. This changes issuer behaviour fleet-wide, so the merge and the roll (dev first) wait for Paul.

Human

Cert warm wakes when its host set grows and retries a new domain's DNS check in minutes, so custom-domain certs issue in seconds instead of up to an hour

Commits 8
Discussions 1 1 open
Tasks 5/6 done

Discussions 1 open

Tasks 5/6 done

  • certWarm wake channel and run loop: a wake runs a pass only for a new host not backing off Done
  • Fast DNS-miss retry for new hosts: 1 min, then 5 min, then hourly Done
  • Fan-out reload hook and home-map ServedHosts wake; wire the warm into both Done
  • Targeted tests, gofmt, vet, cross-compile Done
  • Astra review and fixes Done

Activity