fix(daemon): stamp each run-loop cycle so the systemd watchdog keeps beating
This commit is contained in:
3 files changed
+21
No files matched your search
@@ -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
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user