You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Idle detection never fires on instances whose NIC isn't eth0/ens* (e.g. enp39s0 on m8a/AL2023): network check always returns the 'assume active' 1,000,000 bytes #919
Version: spawn/spored 0.128.2 (38b2d66). Instance: m8a.4xlarge, Amazon Linux 2023.12.20261013, us-west-2.
Symptom:spawn launch demo --instance-type m8a.4xlarge --spot --ttl 1h --idle-timeout 15m -y, then leave it untouched. After 33 minutes (load 0.00, no users) it is still running. spored.log on every tick:
The value is exactly 1,000,000 every minute. spawn status shows the same thing as Network: 976.6 KB/min. Real traffic was a few KB/min:
$ ip -o link show | awk '{print $2}'
lo:
enp39s0:
$ # /proc/net/dev, 10 s apart (rx, tx) — during an SSH session
enp39s0: 217684698 2925026
enp39s0: 217699919 2963423
Cause (pkg/agent/sys_linux.go, sysReadNetworkBytes):
enp39s0 matches neither, so the function returns rx = tx = 0 (not -1). Then in pkg/agent/agent.gogetNetworkBytes():
ifprevRx==0&&prevTx==0 {
return1000000// First call — no delta; assume active
}
is true on every call, because prev stays 0. So the network check always says active, and idle-stop can never trigger. Instances like this run until TTL, and with no --ttl they run until the reaper (if any).
Suggested fix:
Sum all interfaces except lo (and virtual ones like docker*, veth*, br-*), or enumerate /sys/class/net/* and skip those with no device link, rather than matching name prefixes. Predictable names vary by instance family and AMI: eth*, ens*, enp*s*, enX*.
Track "first sample" with a bool instead of prev == 0, and return -1 (unknown) when no interface matched. Then "no matching interface" is logged once as a warning instead of looking like permanent activity.
Add a test with an enp39s0-only /proc/net/dev fixture.
Impact: high. Idle detection is one of spored's three core lifecycle guarantees (and is on the talk slide "Instances that clean up after themselves"). Here it silently does nothing, and status reports "Idle timeout: 15m (currently active)" as if it were working.
Activity
Count physical NICs by structure so idle-stop can fire on enp*s* hosts (
Count physical NICs by structure so idle-stop can fire on enp*s* hosts (
Measure idle disk I/O as a per-tick delta over whole disks found by s…
Measure idle disk I/O as a per-tick delta over whole disks found by s…