This repository was archived by the owner on Mar 13, 2022. It is now read-only.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Watching with
resourceVersion=0
doesn't guarantee the client to continue watching from the last seen state, and therefore may cause missing watch events. The right way to handle a410 Gone
response is to perform a LIST request, and start the watch from theresourceVersion
returned by that new list operation (see https://kubernetes.io/docs/reference/using-api/api-concepts/#efficient-detection-of-changes for more details).This is part of the problems kubernetes-client/python#868 was trying to address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If catch event type of Error and continue like #133 ,will cause endless loop, current resourceVersion never change, always get Error of message:"too old resource version"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make resourceVersion=0 make sure the watch stream still work even if the wrong init resource version set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's what we want and it should not happen
the resourceVersion returned by a LIST request will be the latest resourceVersion, it won't be stale