Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/nix/host-modules/lib
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas be7eaa8181 refresh-consumer: compare mtimes locale-independently so an unchanged secret doesn't restart its unit
`refresh_unit` read the credential file's mtime with
`stat -c %.6Y | tr -d .`. coreutils prints that fraction with the
locale's decimal separator, so on a host whose locale uses a comma
(muede-lpt2: `1791232888,193159`) `tr` stripped nothing, the `-le`
against the unit's start errored, the "unchanged" early return was
skipped, and every run try-restarted the consumer. Every unit on a
store-refresh timer was restarted every ~10 minutes; for
`swarm-bao-ci-runner` that is `gitea-runner-swarm`, which killed every
CI job running at the time.

The mtime is now read with `date -r … +%s%6N`, the same digit-only
format the start time already used (`date -d … +%s%6N` on systemd's
fixed English timestamp), so neither side has a separator for a locale
to change.

A value that still does not read as digits — an unparsable start time,
a missing file — now restarts nothing and logs at `err`. Skipping on
doubt rather than restarting on doubt: the file's mtime is kept, so a
genuinely changed credential still restarts its consumer on the first
run that can read both times, whereas restarting on doubt restarts it
on every run, which is this bug. Both reads also fall back to empty
instead of aborting the caller's `set -e` script.

`script-test-refresh-consumer` runs the rendered helper under
`de_DE.UTF-8` against a stub `systemctl`, and checks first that `stat`
really prints a comma there. The helper on main fails 14 of its
assertions.

Fixes #5230
2026-10-13 17:00:56 +02:00
..
atomic-write-secret.nix lint: tighten atomic-write-secret.nix's header comment; fix vale contractions in persistence.md 2026-09-26 21:50:03 +02:00
bao-pki-dir.nix swarm-nats: the auth responder's store identity path is its own, not the hive's 2026-10-06 10:04:30 +02:00
hive-ca-trust.nix swarm CA: describe the store's pki root as the only anchor in docs and comments 2026-10-05 21:17:10 +02:00
name-guards.nix swarm: refuse swarm.hives keys that are not valid hive identifiers 2026-10-12 21:45:50 +02:00
refresh-consumer.nix refresh-consumer: compare mtimes locale-independently so an unchanged secret doesn't restart its unit 2026-10-13 17:00:56 +02:00
store-refresh-timer.nix nix: re-run the host's store fetches on a ten-minute timer 2026-10-13 00:03:20 +02:00
store-retry.nix credential units: restart consumers on a changed credential; fix the ordering claim 2026-09-30 07:45:47 +02:00