Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] cloneset-controller MAYBE stuck forever because of Event missing #1785

Open
Spground opened this issue Oct 14, 2024 · 1 comment
Open
Assignees
Labels
kind/bug Something isn't working

Comments

@Spground
Copy link
Contributor

Spground commented Oct 14, 2024

What happened:

cloneset-controller stuck in reconcile to wait ScaleExpectations statisfied.

What you expected to happen:

cloneset-controller will never stuck, and continue to reconcile when ScaleExpectations timeout.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:


t1: client-go@kruise-manager watch rv=1

t2: cloneset-controller@kruise-manager create pod A, rv=100, and expectation pod A Create Event using scaleExpectations.ExpectScale(podA)

t3: tons of watch Event coming, now, APIServer watch cache ranage be [rv=100, rv=1000]

t4: pod A deleted by others from etcd

t5: watch connection with APIServer randomly broken, client-go@kruise-manager re-watch with rv=1 and recieved "too old resource versione" becuase of slow watch Event handling(maybe Event produced too fast or Event consumed too slow), then re-list Pods

t6: after re-list Pods, cloneset-controller@kruise-manager will never recieved pod A Create&Delete Event becuase pod A was deleted at t3 

t7: cloneset-controller@kruise-manager will stuck forever util restart

How to fix

	if scaleSatisfied, unsatisfiedDuration, scaleDirtyPods := clonesetutils.ScaleExpectations.SatisfiedExpectations(request.String()); !scaleSatisfied {
		if unsatisfiedDuration >= expectations.ExpectationTimeout {
			klog.Warningf("Expectation unsatisfied overtime for %v, scaleDirtyPods=%v, overtime=%v", request.String(), scaleDirtyPods, unsatisfiedDuration)
// should delete expectation when timeout
			clonesetutils.ScaleExpectations.DeleteExpectations(request.String())
			return reconcile.Result{}, nil
		}
		klog.V(4).Infof("Not satisfied scale for %v, scaleDirtyPods=%v", request.String(), scaleDirtyPods)
		return reconcile.Result{RequeueAfter: expectations.ExpectationTimeout - unsatisfiedDuration}, nil
	}

Environment:

  • Kruise version: 1.5.x
  • Kubernetes version (use kubectl version):
  • Install details (e.g. helm install args):
  • Others:
@Spground Spground added the kind/bug Something isn't working label Oct 14, 2024
@furykerry
Copy link
Member

possible duplication of #1765

@furykerry furykerry assigned zmberg and unassigned FillZpp Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants