Repository navigation
ateom: pluralize the discovery read for multi-actor workers - #1644
Merged
Jeff Luo (JeffLuoo) merged 1 commit intoSep 17, 2026
Merged
Conversation
GetActiveWorkloadStatsResponse's singular oneof said so itself: "an ateom serves one actor at a time, so the sample slot is singular". Multi-actor workers retire that premise, and this is the wire shape changing in place ahead of them, while the capacity cap still makes the list hold at most one entry: repeated WorkloadStatsSample samples = 1; "Available" is the empty list. A workload with no numbers to give yet (boot, restore, teardown, a lifecycle transition underneath the read) is a PENDING entry: attribution and the runtime family with source left STATS_SOURCE_UNSPECIFIED, whose "not measured" meaning the sample already defines. That retires NoSampleReason -- "available" stopped being a reason and "not measurable yet" became a per-workload statement -- and it closes an old gap: a workload that dies during boot is now attributable to a blind caller instead of anonymous. The atelet sweep folds every entry of every response; pending entries contribute nothing anywhere -- not to the aggregates, so sampled_actors keeps meaning "measured", not to the CPU baselines, and no usage event -- exactly as the old no-sample answers behaved. The keyed GetWorkloadStats is untouched: uid-addressed, its per-actor codes stay correct at any worker occupancy. Version skew during a mixed rollout is accepted rather than bridged (no dual population, no fallback decode): singular and repeated message fields of one number share a wire encoding, so mixed versions degrade to undercounting a multi-actor worker or reading a booting one as available for a tick, and converge with the rollout.
Tim Bai (baizhenyu)
requested review from
Jeff Luo (JeffLuoo) and
Da Huang (git286)
September 14, 2026 20:06
Collaborator
Is it true? When the same message field shows up twice, protobuf merges the second into the first instead of replacing it and so the data can be mixed actually |
Collaborator
Author
I don't think so. I would just assume version skew would break the gRPC. Since this is before public GA, so I did not really handle the breaking changes in a graceful way. |
Da Huang (git286)
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 1 of #1640 (adapting the actor resource-telemetry stack to multi-actor workers, #1266): the discovery read's wire shape breaks in place, ahead of the runtime work, while the capacity cap still holds every list to at most one entry.
Contract
GetActiveWorkloadStatsResponsebecomes:The
oneof {sample | no_sample_reason}and theNoSampleReasonenum are deleted outright — noreservedtombstones, per the accepted-skew stance below.source = STATS_SOURCE_UNSPECIFIED, whose "not measured" meaningWorkloadStatsSamplealready defines. It became a per-workload statement because with N workloads it can't be a response-level one — and it closes an old gap: a workload that dies during boot is attributable to a blind caller instead of anonymous.GetWorkloadStatsis untouched: uid-addressed, per-actor codes correct at any occupancy.Consumers
The atelet sweep folds every entry of every response; nothing in it assumes at most one. Pending entries contribute nothing anywhere — not to the aggregates (
sampled_actorskeeps meaning "measured"), not to the CPU delta baselines, and no usage event — exactly matching the old no-sample behavior, so metrics and events are byte-identical before and after this change on a capacity-1 fleet.Version skew: broken
There is no dual population, no fallback decode, no rollout gate (per the decision recorded on #1640). Given that this is prior to GA, I recommend making the breaking change in favor of code simplicity..
Testing
observed_atset); transition-mid-read → pending entry for the new occupant / empty when the slot cleared; the discovery sample stays byte-identical to the keyed read's against the same fixture.verify-all.shclean end to end (includes proto regen check and the metrics registry).Part of #1640, toward #1266.