Watch
0
0
Fork
You've already forked hyperhive
0

keep service containers' boot-wait budgets under their start limit, and check it

This commit is contained in:
atlas 2026-11-02 01:07:26 +01:00 • committed by mara
commit 70b112058a
3 changed files with 553 additions and 9 deletions

View file

@ -1017,9 +1017,17 @@ in
LoadCredential = lib.attrNames storeFiles;
# The forge's answers pass through a temp file.
PrivateTmp = true;
# Each forge call is bounded by curl's own timeouts, and a sealed
# store answers on the port and never answers the write.
TimeoutStartSec = "3min";
# Bounds one attempt, and so the container's boot when the store
# accepts a connection and never answers: this unit is in the boot
# wait of a container with a one-minute start limit. A killed
# attempt is retried with the growing delay below; an attempt
# that minted a token and was killed leaves one the next
# attempt revokes. The account re-check (`accountRecheckSec`) runs
# inside this budget.
TimeoutStartSec = 30;
RestartSec = 5;
RestartSteps = 6;
RestartMaxDelaySec = 300;
};
# `FORGEJO_CUSTOM`, same reason as `forgejo-sso-source` above:
# every `forgejo admin` invocation needs it to find the app.ini

View file

@ -1076,7 +1076,9 @@ in
RemainAfterExit = true;
ExecStart = "${deployCfg.matrix.ctlPackage}/bin/swarm-matrix-ctl appservice render";
# A sealed store answers on the port and never answers the read.
TimeoutStartSec = 60;
# The render and the sync run one after the other in the
# container's boot wait, whose start limit is a minute.
TimeoutStartSec = 20;
RuntimeDirectory = swarmAppserviceRuntimeName;
RuntimeDirectoryMode = "0700";
RuntimeDirectoryPreserve = "yes";
@ -1110,7 +1112,7 @@ in
serviceConfig = storeRetry.serviceConfig // {
Type = "oneshot";
ExecStart = "${deployCfg.matrix.ctlPackage}/bin/swarm-matrix-ctl appservice sync";
TimeoutStartSec = 60;
TimeoutStartSec = 20;
RuntimeDirectory = swarmAppserviceRuntimeName;
RuntimeDirectoryMode = "0700";
RuntimeDirectoryPreserve = "yes";

View file

@ -1192,9 +1192,15 @@ in
// lib.optionalAttrs publishes (
storeRetry.serviceConfig
// {
RestartSec = 15;
LoadCredential = lib.attrNames storeFiles;
TimeoutStartSec = 120;
# Bounds one run, and so the container's boot when the store
# accepts a connection and never answers: this unit is in the
# boot wait of a container with a one-minute start limit.
# What a killed run left is picked up by the next one.
TimeoutStartSec = 30;
RestartSec = 15;
RestartSteps = 3;
RestartMaxDelaySec = 120;
}
);
environment = lib.optionalAttrs publishes (
@ -1281,6 +1287,11 @@ in
// lib.optionalAttrs publishes {
RuntimeDirectory = "swarm-authelia-bridge";
LoadCredential = lib.attrNames storeFiles;
# The secret fetch is part of the start job, which is in the
# container's boot wait: a store that never answers ends it here
# and not at the 90 s default, which is over the container's
# one-minute start limit.
TimeoutStartSec = 10;
};
environment = {
SWARM_AUTHELIA_BRIDGE_SOCKET = bridgeSocket;