KamoCRM

X keeps counting through a sleep, so every resumed computer went straight back to sleep

FixKlusterServices
Ya
24 Septemba 2026, 08:48 UTC
Mwandishi
Kamo
Ahadi ya
c657eb1

A member opening their computer got a black tab. The launch was fine, the wake was fine, the resume was fine — and then the machine powered itself off before the browser could connect to it. From the cluster, at 08:38 today: VirtualMachineInstance started. (08:35:33) computer hc-...-7dcfc3f4194a has been idle 2564s (limit 30m) — asking it to sleep (08:38:13) Stopped the virtual machine by deleting the virtual machine instance [console] reboot: Power down A computer that had been up for 160 seconds reported 42 minutes of idleness. Guacamole authenticated the member and then never opened a tunnel, because by then there was nothing listening on 3389 — guacd logged not one connection attempt all morning. xprintidle answers "how long since this X session was last touched", and THE X SERVER KEEPS COUNTING ACROSS A SUSPEND-TO-DISK. It restores with the input timestamp it had, so every hour the machine spends powered off is returned as an hour of idleness. Both consumers then did exactly what they are built to do with that number: the agent's own watcher hibernates at the limit, and computeservice's idle sweep asks it to. The member's wake was undone within one sweep, every time. This is not the resume bug fixed in a607fea, it is the half that one missed. That commit restarts `last_active` when the wall clock shows a gap — and poll() then overwrote it three lines later from the very counter that is wrong, so the reset never survived a single poll. A computer cannot have been idle for longer than it has been awake. That invariant is the fix, and it holds whatever X believes: `_awake_since` is set at start and again on every detected resume, and every answer this class gives is clamped to it. The resume detection also moves out of tick() into note_resume(), called from idle_seconds() as well. computeservice asks for status on its own schedule, and whichever read lands first after a resume is the one whose answer decides whether the machine is put back to sleep; when the reset lived only in tick(), a status call arriving first reported the pre-sleep idleness and the sweep acted on it. Four existing tests set last_active into the past without saying how long the machine had been up, which the invariant now exposes as a fiction — a computer idle for an hour has been awake for one. They say both now. Three new tests cover the resume, the clamp not becoming a second idle policy, and a status call that arrives before the first tick.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila kitu kinaingia kwenye tovuti yako mwenyewe. Anza kwenye mpango wa bure na usome ukurasa huu tena katika mwezi mmoja.

Kuwa Huru MileleMtazamo wa bei