Watch
0
0
Fork
You've already forked hyperhive
0

fix(matrix): queue tuwunel's start after the guest's boot is over

The deferred starter was a oneshot that ran `systemctl start --no-block
tuwunel` inside the boot transaction. A --no-block start still queues a
start job, so the guest's job queue stayed non-empty for as long as
tuwunel's start took, and the container (Type=notify, --notify-ready=yes,
one minute) never reported ready and was killed at its limit.

The starter is now Type=simple, so its own start job ends at the fork. It
waits for `systemctl is-system-running --wait` and only then queues the
service. The VM test waits for the daemon to reach `activating` instead of
asserting it the moment the container's start ends.
This commit is contained in:
maia 2026-11-28 05:57:08 +01:00 • committed by mara
commit 3919de6358

View file

@ -990,9 +990,14 @@ let
# the beginning every time) can outlast the container's one-minute limit,
# and a start killed on it makes no progress. So tuwunel is out of the
# guest's boot: not wanted by `multi-user.target`, started `--no-block` by
# a oneshot that is, with a limit of its own. The sync and the render stay
# in the boot wait, the presence arms of the walk that finds tuwunel
# absent from it.
# a unit that is, with a limit of its own. A `--no-block` start still
# queues a job and the container's start ends when the guest's queue is
# empty (a oneshot starter, which queued it during the boot, held the
# container's start for the daemon's 90 s in the nightly VM test), so the
# starter is `Type=simple`, holds no job, and queues the daemon only after
# `is-system-running --wait` says the boot is over. The sync and the
# render stay in the boot wait, the presence arms of the walk that finds
# tuwunel absent from it.
name = "the homeserver starts after the container is up, under a limit of its own, and the container's boot does not wait on it";
ok =
let
@ -1006,9 +1011,9 @@ let
&& unit.wantedBy == [ ]
&& bootWait.spanSeconds unit.serviceConfig.TimeoutStartSec == 1800
&& starter.wantedBy == [ "multi-user.target" ]
&& starter.serviceConfig.Type == "oneshot"
&& starter.serviceConfig.TimeoutStartSec == 20
&& lib.hasSuffix "/bin/systemctl start --no-block tuwunel.service" starter.serviceConfig.ExecStart
&& starter.serviceConfig.Type == "simple"
&& !(bootWait.holdsJob starter)
&& lib.hasInfix "systemctl is-system-running --wait >/dev/null || true\nsystemctl start --no-block tuwunel.service" starter.script
&& !(lib.elem "tuwunel.service" booted)
&& lib.elem "swarm-container-deferred-start.service" booted
&& lib.elem "swarm-matrix-appservice-sync.service" booted