mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-10-07 19:28:51 +02:00
Defer scale up until the listener publishes a state that accounts for finished runners
Spec.Replicas is the count the listener asked for when it published Spec.PatchID. When the EphemeralRunnerSet controller cleaned up finished runners in the same reconcile, it then compared that count against a live count the cleanup had just reduced, and created runners to replace jobs that had already completed. Nobody asked for those runners. Delete the finished runners, record the patch ID the cleanup belongs to in Status.FinishedRunnerCleanupPatchID, and return, so the scaling decision is made on the next reconcile against post-cleanup data. Scale up stays suppressed while Spec.PatchID still equals that recorded patch ID: the gap below Spec.Replicas is the one the cleanup opened, not new demand. The listener marks itself dirty on every job completion and publishes a fresh incrementing patch ID, so the suppression lifts as soon as it reports a desired state that accounts for the completions. Runners that are mid-deletion were not counted at all, which let the controller over-create while deletions were still in flight. Count them towards the scale-up total. The cleanup helper is renamed to deleteTerminatedEphemeralRunners because it is no longer specific to finished runners. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot App
parent
26e62ec8ba
commit
e3656c69ff
@@ -53,6 +53,12 @@ type EphemeralRunnerSetStatus struct {
|
||||
// Unset defaults to 0.
|
||||
// +optional
|
||||
AppliedActionableRevision int64 `json:"appliedActionableRevision,omitempty"`
|
||||
// FinishedRunnerCleanupPatchID records the listener patch ID for which finished
|
||||
// ephemeral runners were cleaned up. Scale-up is suppressed for the same patch ID
|
||||
// until the listener publishes a fresh desired-state patch.
|
||||
// Unset defaults to 0.
|
||||
// +optional
|
||||
FinishedRunnerCleanupPatchID int `json:"finishedRunnerCleanupPatchID,omitempty"`
|
||||
}
|
||||
|
||||
// EphemeralRunnerSetPhase is the phase of the ephemeral runner set resource
|
||||
|
||||
Reference in New Issue
Block a user