[codex] stabilize pool scaling - #1425
Open
GodBlf wants to merge 1 commit into
Open
Conversation
GodBlf
marked this pull request as ready for review
July 30, 2026 09:40
GodBlf
requested review from
Generalwin,
Pangjiping,
Spground,
fengcone,
hittyt,
jwx0925,
kevinlynx and
ninan-nn
as code owners
July 30, 2026 09:40
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.
Summary
PoolStatus.UpdatedscaleStrategy.maxUnavailableand wait for deletions to finishPoolMaxRoot cause
Six behaviors amplified one another under slow-starting runtimes: the Helm CRD pruned
status.updated, buffer calculations treated Pending pods as available, the buffer target jumped to its midpoint outside the configured band, scale-down was unbounded, terminating pods disappeared from occupancy accounting, and scale-down selected the oldest Ready pods first. Together these caused a hot reconcile loop and sustained pod create/delete oscillation.Impact
The controller now converges without repeatedly replacing usable pool capacity. Existing Pool manifests remain compatible: no CRD fields, CLI flags, or Helm values were added. The existing
scaleStrategy.maxUnavailablesetting now limits both scale-up and scale-down batch sizes; the default remains 25%.Validation
KUBEBUILDER_ASSETS="..." go test ./internal/controller -count=1(36 envtest specs)go test ./internal/utils/expectations/... -count=1go test ./... -run '^$'go vet ./internal/controller ./internal/utils/expectations/...helm lint charts/opensandbox-controller.status.updatedand theUPDATEDprinter columnpnpm docs:buildgit diff --checkCloses #1423