Manage resourceVersion to allow resilient restart of watch method #2223
Labels
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
kind/feature
Categorizes issue or PR as related to a new feature.
What is the feature and why do you need it:
We are using the method stream of object Watch
python/kubernetes/base/watch/watch.py
Line 129 in 94e4211
Let say i use this method with v1.list_namespace with no timeout specified (https://github.com/kubernetes-client/python/blob/master/examples/watch/timeout-settings.md) then we see that:
If during the 30min 1 hour period a namespace is created then the watch store a more recent resourceVersion and then the 410 is reached quite further in the time (probably depending of the history or activity on the cluster).
Describe the solution you'd like to see:
From our test the good resourceVersion to plan a restart is not the resourceVersion of the last event seen but the resourceVersion available in the metadata in the func argument of the stream metdhod func .
In the response there is a metadata.resourceVersion given by kubernetes that allow to restart the stream from this resourceVersion that generate no error.
Not sure if this metadata is available on all func method.
It's quite hard to understand how to use the watch method in the api if we want to maintain a daemon program with no error.
With a no resourceVersion and no timeout specified everyone should now that there is this kind of problem due to the self.resourceVersion storage
The text was updated successfully, but these errors were encountered: