rickub/portalpublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/rickub/portal.git
git clone ssh://git@rickub.com/rickub/portal.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

ciguest: fail fast when the watcher dies #1

Open@ogirardot wants to merge fix/watcher into main
1 file changed
modified internal/watcher/watch.go +3 -3
@@ -2,9 +2,9 @@ package watcher
22
33 // Watch drives the guest loop: poll, apply, report.
44 //
5-// Fail fast: a silent watcher is worse than a dead one, so any poll or
6-// apply error is returned to the caller (cmd/ciguest exits non-zero and
7-// the supervisor restarts us) instead of being logged and forgotten.
5+// Fail fast: a silent watcher is worse than a dead one — a poll or apply
6+// error is returned to the caller, cmd/ciguest exits non-zero, and the
7+// supervisor restarts us instead of us polling forever on a broken socket.
88 func Watch(interval string) error {
99 tick := parseInterval(interval)
Request change: this should change before merge @ogirardot Sep 23, 2026 Permalink to @ogirardot's comment

Clamp or refuse: a zero interval here silently busy-loops the guest.

1010 for range tick {
@@ -2,9 +2,9 @@ package watcher
2 2
3 // Watch drives the guest loop: poll, apply, report.3 // Watch drives the guest loop: poll, apply, report.
4 //4 //
5-// Fail fast: a silent watcher is worse than a dead one, so any poll or5+// Fail fast: a silent watcher is worse than a dead one — a poll or apply
6-// apply error is returned to the caller (cmd/ciguest exits non-zero and6+// error is returned to the caller, cmd/ciguest exits non-zero, and the
7-// the supervisor restarts us) instead of being logged and forgotten.7+// supervisor restarts us instead of us polling forever on a broken socket.
8 func Watch(interval string) error {8 func Watch(interval string) error {
9 tick := parseInterval(interval)9 tick := parseInterval(interval)
10 for range tick {10 for range tick {