diff --git a/CHANGELOG.md b/CHANGELOG.md index 28438dfee..5663a6da4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/internal/daemon/cycle_test.go b/internal/daemon/cycle_test.go new file mode 100644 index 000000000..46aaad5dc --- /dev/null +++ b/internal/daemon/cycle_test.go @@ -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") + } +} diff --git a/internal/daemon/daemon.go b/internal/daemon/daemon.go index 713954f7e..15413069a 100644 --- a/internal/daemon/daemon.go +++ b/internal/daemon/daemon.go @@ -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) }