Watch
0
0
Fork
You've already forked hyperhive
0

swarm-otel: a timer starts the receiver-socket check again while it is failed

swarm-otel-sockets probes once at activation. On a fresh swarm the
collector opens its sockets only after authelia answers, which is after
the operator unseals the store, so the probe failed and stayed failed
after ingest worked: the only red unit on the swarm.

swarm-otel-sockets-recheck.timer now starts it again each minute, and
only while it is failed (an ExecCondition on systemctl is-failed), with
a restart that does not block. The check itself gets no Restart: a
oneshot's start job stays pending through an automatic restart, so a
switch would wait on it for as long as the collector is down, and the
failed check is what the switch reports. full-setup waits for the check
to be active after the collector has recovered, and the module-eval case
pins the timer, the condition and the absence of a Restart.

Closes #6836
This commit is contained in:
maia 2026-11-24 16:36:51 +01:00
commit 912b2d9570

View file

@ -1230,6 +1230,31 @@ let
&& lib.elem "container@swarm-otel.service" u.partOf
&& lib.elem "multi-user.target" u.wantedBy;
}
{
# On a fresh swarm the collector opens its sockets only after the store
# is unsealed, long after the check's one attempt at activation. The check
# itself is never restarted by systemd: a oneshot's start job stays
# pending through an automatic restart, and a switch would wait on it for
# as long as the collector is down. A timer starts it again, only while it
# is failed (`ExecCondition`) and without blocking. Without the condition
# a healthy check would restart every minute; without `timers.target` the
# timer would never run.
name = "a failed receiver-socket check is started again by a timer, and the check is not restarted by systemd";
ok =
let
host = serviceContainersWithCi;
check = host.systemd.services.swarm-otel-sockets;
re = host.systemd.services.swarm-otel-sockets-recheck;
t = host.systemd.timers.swarm-otel-sockets-recheck;
in
!(check.serviceConfig ? Restart)
&& re.serviceConfig.Type == "oneshot"
&& lib.hasInfix "is-failed --quiet swarm-otel-sockets.service" re.serviceConfig.ExecCondition
&& lib.hasInfix "restart --no-block swarm-otel-sockets.service" re.serviceConfig.ExecStart
&& lib.elem "timers.target" t.wantedBy
&& t.timerConfig.OnUnitActiveSec == "1min"
&& t.timerConfig ? OnActiveSec;
}
{
# `DynamicUser` forces `ProtectSystem=strict`, which leaves `/run`
# read-only unless the path is in `ReadWritePaths`. The controls: the