kubernetes / client-go

Go client for Kubernetes.
Apache License 2.0
8.99k stars 2.93k forks source link

SharedIndexInformer not calling event handlers during the first resync #1312

Closed CiprianAnton closed 6 months ago

CiprianAnton commented 11 months ago

This issue is the root cause for https://github.com/argoproj/argo-workflows/issues/10947

Based on my tests, the issue was introduced between client-go v0.24.0-alpha.1 and v0.24.0-alpha.2.

Seems like when the first resync happens (20 minutes in case of argo-workflows), the event handlers are not being called.

I was able to identify a potential change that introduced this: https://github.com/kubernetes/client-go/commit/54928eef9f824667b23a938188498992d437156a#diff-dbac68d65bbc9814c2336df6ee91f22e807d84a9127a4d34a8b39c5657d0e447L551

Looking at the code, there is small behavior change when evaluating the isSync flag:

All an in one, there might be a chance of falsely setting isSync to true.

This flag is being used in distribute, which conditionally calls the listeners.

The issue also reproduces with latest client-go version: v0.29.0-alpha.2

k8s-triage-robot commented 8 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 7 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 6 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 6 months ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes/client-go/issues/1312#issuecomment-2028682970): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
tooptoop4 commented 1 hour ago

any ideas @alexzielenski @howardjohn @lavalamp @liggitt @dims @pohly ?

dims commented 1 hour ago

/remove-lifecycle stale

tooptoop4 commented 29 minutes ago

/reopen

k8s-ci-robot commented 29 minutes ago

@tooptoop4: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to [this](https://github.com/kubernetes/client-go/issues/1312#issuecomment-2387066147): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.