-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
watch loses resource version when watching custom object list #700
Comments
reproducing script: manifests:
Run with printing the resource version in
|
probably a duplicate of #693 |
probably a duplicate of what issue? You've linked back to this one. Maybe you meant #693 ? |
fixed and updated the reproducer with manifests |
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Dec 11, 2018
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by not resetting to an older version than the one specified in the watch. It does not handle overflows of the resource version but they are 64 bit integers so they should not realistically overflow even in the most loaded clusters. Closes kubernetes-client/python#700
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Dec 11, 2018
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by not resetting to an older version than the one specified in the watch. It does not handle overflows of the resource version but they are 64 bit integers so they should not realistically overflow even in the most loaded clusters. Closes kubernetes-client/python#700
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Dec 11, 2018
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by not resetting to an older version than the one specified in the watch. It does not handle overflows of the resource version but they are 64 bit integers so they should not realistically overflow even in the most loaded clusters. Closes kubernetes-client/python#700
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Dec 12, 2018
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by not resetting to an older version than the one specified in the watch. It does not handle overflows of the resource version but they are 64 bit integers so they should not realistically overflow even in the most loaded clusters. Closes kubernetes-client/python#700
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Jan 19, 2019
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by setting the minimum resource version to reset from to the input resource version. As long as k8s returns all objects in order in the watch this should work. We cannot use the integer value of the resource version to order it as one should be treat the value as opaque. Closes kubernetes-client/python#700
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Jan 19, 2019
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by setting the minimum resource version to reset from to the input resource version. As long as k8s returns all objects in order in the watch this should work. We cannot use the integer value of the resource version to order it as one should be treat the value as opaque. Closes kubernetes-client/python#700
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Jan 22, 2019
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by setting the minimum resource version to reset from to the input resource version. As long as k8s returns all objects in order in the watch this should work. We cannot use the integer value of the resource version to order it as one should be treat the value as opaque. Closes kubernetes-client/python#700
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Jan 22, 2019
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by setting the minimum resource version to reset from to the input resource version. As long as k8s returns all objects in order in the watch this should work. We cannot use the integer value of the resource version to order it as one should be treat the value as opaque. Closes kubernetes-client/python#700
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Jan 22, 2019
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by setting the minimum resource version to reset from to the input resource version. As long as k8s returns all objects in order in the watch this should work. We cannot use the integer value of the resource version to order it as one should be treat the value as opaque. Closes kubernetes-client/python#700
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Jan 23, 2019
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by setting the minimum resource version to reset from to the input resource version. As long as k8s returns all objects in order in the watch this should work. We cannot use the integer value of the resource version to order it as one should be treat the value as opaque. Closes kubernetes-client/python#700
juliantaylor
added a commit
to juliantaylor/python-base
that referenced
this issue
Jan 23, 2019
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by setting the minimum resource version to reset from to the input resource version. As long as k8s returns all objects in order in the watch this should work. We cannot use the integer value of the resource version to order it as one should be treat the value as opaque. Closes kubernetes-client/python#700
This was referenced Apr 25, 2019
dudleyhunt86
added a commit
to dudleyhunt86/python-base-repository-build
that referenced
this issue
Oct 7, 2022
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by setting the minimum resource version to reset from to the input resource version. As long as k8s returns all objects in order in the watch this should work. We cannot use the integer value of the resource version to order it as one should be treat the value as opaque. Closes kubernetes-client/python#700
bh717
pushed a commit
to bh717/python-dapp
that referenced
this issue
Apr 1, 2024
The watch code reset the version to the last found in the response. When you first list existing objects and then start watching from that resource version the existing versions are older than the version you wanted and the watch starts from the wrong version after the first restart. This leads to for example already deleted objects ending in the stream again. Fix this by setting the minimum resource version to reset from to the input resource version. As long as k8s returns all objects in order in the watch this should work. We cannot use the integer value of the resource version to order it as one should be treat the value as opaque. Closes kubernetes-client/python#700
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kubernetes often resets watches when no changes happen (kubernetes/kubernetes#55230 (comment)), thus I have added a restart at the last resource version to my application
But the python api library resets this to zero on iteration of this loop and thus retrieves all objects again.
https://github.com/kubernetes-client/python-base/blob/83ebb9d5fdc0d46bbb2e30afcd8eec42c5da4ad1/watch/watch.py
This happens in current master using the list_cluster_custom_object function as a watch running against kubernetes 1.12.3.
Can this please be updated to respect the resource version set by the application or fix that it resets to version zero each time.
The text was updated successfully, but these errors were encountered: