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
Commit 0f5a684
Browse filesBrowse the repository at this point in the historyBrowse files
atelet: pin the multi-actor stats fold and keep CPU baselines across pending sweeps
Ateoms now return one GetActiveWorkloadStats entry per hosted actor. The
atelet sweep already folded every entry, but nothing tested it above one
actor per worker, and reviewing the fold found CPU accounting defects.
A pending entry (boot, restore, teardown, or a guest the ateom did not
reach) never wrote the actor's CPU baseline, and lastCPU is rebuilt each
sweep, so measured -> pending -> measured lost the whole interval. Pending
entries now carry the baseline forward; only actors absent from every
response drop it.
Carrying it unconditionally could overwrite a value another worker measured
in the same sweep (a restore in flight: the source still reports the actor),
charging the interval twice on the next sweep. The pending branch now writes
only if no worker measured the actor this sweep.
A CPU decrease was charged as the whole new value. That is right for a
cgroup counter, which restarts at zero on restore, but not always for a
guest-agent counter: a FULL or golden restore resumes a guest at that
guest's counter, a cold boot restarts it at zero, and a container exit
lowers the sum. A guest-agent decrease cannot tell these apart, so it now
charges nothing and re-baselines. That loses the usage from the event to
the first sample. Main counted it correctly only after a cold boot (a DATA
restore, or a Run after a crash); in every other case main overcounted it.
An epoch that starts above the last value stays undetectable, as the proto
notes, and carrying the baseline extends that limit to restores that span a
pending sweep.
Tests cover the fold over a multi-actor worker, per-actor baselines,
per-entry events, baseline carry across a pending sweep, the decrease rule
per source with and without a pending sweep, and the two-worker restore
case in both fold orders. That last one orders the probes on the fold
itself, via the connection close that follows it, rather than a sleep.
The poll floor (50s) is one actor's worst-case micro-VM read, 25
containers at 2s each. Sweeps are sequential, so it bounds guest-agent
load, not overlap. The RPC timeout (55s) was documented as covering that
single-actor worst case. With several actors per worker, the micro-VM ateom
caps its read at a 45s budget and reports unreached guests as pending, so
the timeout stays constant. The comments now say so.
0 commit comments