-
Notifications
You must be signed in to change notification settings - Fork 550
Informer example requires fix: infomer restarted after onerror event doesn't dispatch other events #795
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
Comments
That is expected. Events should only be fired for newly added things (since presumably you already received events for the earlier things). This should be consistent with the way informers work in other languages also. |
Yes, this behaviour is clear… but after informer.start inside an onerror handler, if I remove a k8s resource and recreate that resource the events delete/add are never fired. |
@faxioman that's true, in that case you should receive an Given the way that the Kubernetes API works, if the watch drops for some reason (forcing a re-list to occur) then I believe it isn't possible to tell the difference between whether an object was deleted and re-added, or that it was simply updated. Does this behavior cause problems for you? I wouldn't expect that it would cause problems for your operator as it should always be looking at the 'current' state. As mentioned above, you should get an 'update' event, if you don't get that, then we should figure out why not. |
@brendandburns ok, I'll check if an update event is raised. |
Hrm, that seems like a bug. Once the informer is restarted, if you delete something, you should see the delete event. Can you provide more details on the repro (or sample code) thanks |
Friendly ping for more details if you have them. Thanks! |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
I have a suspicion that some recent changes affected this to the opposite - I'm now seeing unhandled Will be digging deeper... |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
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-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Describe the bug
The informer example shows a way to deal with errors:
But when an error occurs (eg. the api server pod is restarted) if you restart the informer with informer.start(), all the events (add, delete, update) are never fired again.
I don't know if this is a desired behaviour and the example is wrong or the example is fine and the informer has a bug.
** Client Version **
0.16.3
** Server Version **
Kubernetes v1.23.3
To Reproduce
Execute the informer, restart the api server, observe that informer events are never fired
Expected behavior
After an error event and an informer restart, all add/delete/update event for the informer should be fired again
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: