Commit 266136a
Kevin Wang
fix(gateway): one lock for every operation on the shared ACME account
Rotation, CAA reconciliation, and first-use registration all read or
re-pin the same account, so they now take the same KV lock. Two
consequences.
Registration under the lock cannot be reached from inside a region that
already holds it: set_caa_all held the in-process caa_lock across its
per-domain loop, and a fresh cluster's first SetCaa registers from inside
that loop -- which, with a non-reentrant tokio Mutex and no timeout, hung
the task and left the lock held for the life of the process. set_caa_all
now registers the account before it takes the lock, where the steady
state costs one KV read.
Dropping caa_lock for the KV lock also widens what is ordered: CAA
reconciliation was serialized within a process only, so one node's SetCaa
could interleave with another's rotation over the same zone. Reconciling
rewrites a zone's issuer records in place -- guard, sweep, write, unguard
-- and two runs over one zone delete each other's records, which can
leave the ";" guards behind and block issuance until a later run
succeeds.1 parent 05b1d65 commit 266136a
3 files changed
Lines changed: 263 additions & 110 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
0 commit comments