make bao readers want swarm-bao-pki and drop its start limit
A pki start refused by its start limit failed every reader that Requires= it with `dependency`. That leaves a unit inactive, not failed, so Restart=on-failure never fired and readers without a refresh timer never ran again (#5381: grafana 502 for ~43 min). Readers and granting units now Wants= + After= pki; one whose leaf is still missing fails its login with exit 1 into its existing retry. pki gets StartLimitIntervalSec=0: it is deliberately not RemainAfterExit, so each reader's start re-runs it.
This commit is contained in:
parent
141be16c6d
commit
265f8a47cc
12 changed files with 95 additions and 46 deletions
|
|
@ -1097,14 +1097,16 @@ let
|
|||
{
|
||||
# Every granting unit retries a sealed or late store for a day, in the
|
||||
# `[Unit]` section systemd reads it from, and waits for the unit that
|
||||
# mints the granter's leaf.
|
||||
name = "each granting unit requires the PKI unit and retries 2880 times at 30s";
|
||||
# mints the granter's leaf. Wanted, never required: a refused pki start
|
||||
# fails a requirer's job with `dependency`, which no `Restart=` retries.
|
||||
name = "each granting unit wants, not requires, the PKI unit and retries 2880 times at 30s";
|
||||
ok = lib.all (
|
||||
unit:
|
||||
let
|
||||
u = baoGrantHere.systemd.services.${unit};
|
||||
in
|
||||
lib.elem "swarm-bao-pki.service" u.requires
|
||||
lib.elem "swarm-bao-pki.service" u.wants
|
||||
&& !(lib.elem "swarm-bao-pki.service" u.requires)
|
||||
&& lib.elem "swarm-bao-pki.service" u.after
|
||||
&& lib.elem "swarm-bao-granter-role.service" u.after
|
||||
&& !(lib.elem "swarm-bao-granter-role.service" (u.requires ++ u.wants))
|
||||
|
|
@ -1114,6 +1116,14 @@ let
|
|||
&& u.serviceConfig.Restart == "on-failure"
|
||||
) grantingUnitNames;
|
||||
}
|
||||
{
|
||||
# Every reader and granting unit's start pulls the PKI unit in, so a mass
|
||||
# container start outruns systemd's default limit of 5 starts in 10s.
|
||||
name = "the PKI unit has no start limit";
|
||||
ok =
|
||||
toString (baoGrantHere.systemd.services.swarm-bao-pki.unitConfig.StartLimitIntervalSec or "unset")
|
||||
== "0";
|
||||
}
|
||||
{
|
||||
# A oneshot has no start timeout by default, so an attempt that never
|
||||
# ends never fails into a retry.
|
||||
|
|
|
|||
Loading…
Reference in a new issue