Skip to content

Commit 6b465d4

Browse files
authored
Merge pull request #906 from Spground/feature/public-fix-pool-scale-expecation-stuck
feat(k8s): Fix pool scale expectation stuck
2 parents 84e9e06 + abadbf1 commit 6b465d4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

kubernetes/internal/controller/pool_controller.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,14 @@ func (r *PoolReconciler) scalePool(ctx context.Context, pool *sandboxv1alpha1.Po
674674
errs := make([]error, 0)
675675
pods := args.pods
676676
if satisfied, unsatisfiedDuration, dirtyPods := PoolScaleExpectations.SatisfiedExpectations(controllerutils.GetControllerKey(pool)); !satisfied {
677-
log.Info("Pool scale is not ready, requeue", "unsatisfiedDuration", unsatisfiedDuration, "dirtyPods", dirtyPods)
678-
return fmt.Errorf("pool scale is not ready, %v", pool.Name)
677+
if unsatisfiedDuration >= expectations.ExpectationTimeout {
678+
log.Info("Pool scale expectations timed out, clearing stale expectations",
679+
"unsatisfiedDuration", unsatisfiedDuration, "dirtyPods", dirtyPods)
680+
PoolScaleExpectations.DeleteExpectations(controllerutils.GetControllerKey(pool))
681+
} else {
682+
log.Info("Pool scale is not ready, requeue", "unsatisfiedDuration", unsatisfiedDuration, "dirtyPods", dirtyPods)
683+
return fmt.Errorf("pool scale is not ready, %v", pool.Name)
684+
}
679685
}
680686
schedulableCnt := int32(len(args.pods))
681687
totalPodCnt := args.totalPodCnt

0 commit comments

Comments
 (0)