fix(daemon): stamp each run-loop cycle so the systemd watchdog keeps beating
Quality / check (push) Successful in 3m37s
deploy / gate (push) Successful in 4m27s
deploy / archied-image (push) Successful in 2m54s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped

This commit is contained in:
sam committed 2026-11-02 00:22:24 +11:00
1 parent 6abfe32540
commit 1043982529
3 files changed
+21

No files matched your search

+4
View File
@@ -5,6 +5,10 @@ release's per-component sections are labelled beneath its heading.
## [Unreleased]
### archied
- archied no longer restarts about a minute after it starts. Under systemd, the watchdog never saw a poll pass and killed it on every start since 1.56.0.
## [1.58.0] - 2026-11-01
### archied
+16
View File
@@ -0,0 +1,16 @@
package daemon
import (
"context"
"testing"
)
// The systemd watchdog beats only while LastPollAt is fresh, so a cycle that
// doesn't stamp it gets archied killed shortly after every start.
func TestCycleMarksPollPass(t *testing.T) {
d := &Daemon{}
d.Cycle(context.Background())
if d.LastPollAt().IsZero() {
t.Fatal("Cycle didn't record a poll pass")
}
}
+1
View File
@@ -489,6 +489,7 @@ func (d *Daemon) RunOnce(ctx context.Context) {
// tasks; maintenance runs as built-in schedules. Draining queued tasks is the caller's job
// (drainLoop in Run, drainNATS in RunOnce) so there is one drainer.
func (d *Daemon) Cycle(ctx context.Context) {
d.markPoll("")
d.dispatchBindings(ctx)
d.drainReactions(ctx)
}