Repository navigation
Conversation
The EphemeralRunnerSet reconciler counts its runners from the informer cache and records nothing about the runners it creates. The watch event of the first runner of a batch requeues the set before the cache holds the others. When the listener publishes a new patch ID in that window, the reconcile reaches the scaling block with a partial count and creates the missing runners a second time, so the set ends above Spec.Replicas. Before a scale up, count the set's runners again through APIReader and create only the real shortfall. The extra read is one namespace LIST per scale-up decision, not per reconcile. Fixes actions#4722 Co-Authored-By: Claude Opus 5.5 <[email protected]>
yaronr
requested review from
a team,
Steve-Glass,
mumoshu,
nikola-jokic,
rentziass and
toast-gear
as code owners
October 21, 2026 08:18
4 tasks done
Author
|
We hit this in production on 0.15.0 and currently carry a controller patch for it. #4723 (ours) and #4744 both target this bug, and we're happy with whichever approach the maintainers prefer. We'd rather drop our patch than get ours merged. We can share our production evidence and regression test with either PR. One thing to check on the #4744 approach: if a runner is deleted while its create is still counted as unseen, replacement could be delayed until the 60s window expires. #4704 shows replacement latency already matters. Please keep this issue open while the fix is in review. |
This branch has not been deployed
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.
Fixes #4722
Problem
The EphemeralRunnerSet reconciler counts its runners from the informer cache (
r.ListwithresourceOwnerKey) and records nothing about the runners it has just created. The watch event of the first runner of a scale-up batch requeues the set before the cache holds the rest of the batch. If the listener publishes a newpatchIDin that window, the reconcile passes the patch-ID check, sees a partial count, and creates the missing runners a second time. The set ends aboveSpec.Replicas, and each extra runner holds a pod (and, with a cluster autoscaler, a node) until scale down can retire it.0.15.0 made the window wider: runners of a batch are now created in parallel, and
updateStatusno longer writes a status PATCH after every create, so the reconcile returns right after the lastCreateresponse.Fix
In the scale-up branch, count the set's runners again through
APIReaderand create only the real shortfall. Ownership is filtered in process, as inpatchAppliedActionableRevisionStatus, becauseresourceOwnerKeyis a cache-only index. The extra read is one namespace LIST per scale-up decision, not per reconcile. The controller logsUncached runner count differs from the cached countwhen the two counts differ.Tests
TestScaleUpDoesNotRecreateRunnersMissingFromTheCache: a cache-backed client that lists only the first created runner, plus apatchIDbump between two reconciles. Without the fix the set ends with 3 runners forreplicas: 2; with it, 2.go test -skip '^TestAPIs$' ./controllers/actions.github.com/...: ok.TestAPIs, 186 specs, envtest 1.37.0): ok.gofmt -landgo veton the package: clean.Production evidence
We run this change on 0.15.0 for a CI scale set. In one run the listener published
replicas: 1and thenreplicas: 2within about 2 s. The controller logged"cached": 1, "uncached": 2, "desired": 2and created no third runner. Without the change, that reconcile would have created one.🤖 Generated with Claude Code