-
Notifications
You must be signed in to change notification settings - Fork 2k
Reflector list should handle expired resource version from watch handler as well #1628
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
Reflector list should handle expired resource version from watch handler as well #1628
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aaruna The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
7eed8bb
to
36edb18
Compare
This looks good to me, but I want @yue9944882 to take a look at this also, since he was the primary author of this code. |
@yue9944882 Any thoughts on this? |
"ResourceVersion {} and Watch connection expired: {} , will retry w/o resourceVersion next time", | ||
getRelistResourceVersion(), | ||
item.status.getMessage()); | ||
isLastSyncResourceVersionUnavailable = true; |
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.
@aaruna upon 410 status code, the watch handler is supposed to return and we deal w/ the RV expiration at the list call. this is working as designed. https://github.com/kubernetes/kubernetes/blob/a96000311f5beca111debc8727018e42cbb5dc79/staging/src/k8s.io/client-go/tools/cache/reflector.go#L129-L131
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.
Are you referring to the next list call? Because the current watch handler won't throw an ApiException and only that is handled in the catch block above. (The unit test added in this PR shows an example of this scenario)
CC @jiangzhou in case I have missed anything in the scenario above.
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.
Are you referring to the next list call?
yeah. IIRC watch handler doesnt directly throw an ApiException but it will deal w/ error status nested in the decoded watch event.
java/util/src/main/java/io/kubernetes/client/informer/cache/ReflectorRunnable.java
Lines 227 to 237 in c580990
if (eventType.get() == EventType.ERROR) { | |
if (item.status != null && item.status.getCode() == HttpURLConnection.HTTP_GONE) { | |
log.info("Watch connection expired: {}", item.status.getMessage()); | |
return; | |
} else { | |
String errorMessage = | |
String.format("got ERROR event and its status: %s", item.status.toString()); | |
log.error(errorMessage); | |
throw new RuntimeException(errorMessage); | |
} | |
} |
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.
But that's not resetting isLastSyncResourceVersionUnavailable=true
. The unit test below has an example
/hold for discussion |
@yue9944882 what is the status of this PR/Discussion? |
I have upgrade to client 13.0.0 and now we are floored with these messages. It looks like a very clear regression. I am getting deja vu. It looks like the same pattern, we are not resetting isLastSyncResourceVersionUnavailable back to true when HTTP_GONE occurs. @aaruna change looks good to me. 13.0.0 is unusable as it is. Waiting for update on this. @aaruna can you rebase? |
36edb18
to
1f9413d
Compare
@tony-clarke-amdocs I have rebased the PR. |
Thanks @aaruna. @brendandburns @yue9944882 Can you guys review when you get a chance. It's a blocker for us. |
@brendandburns @yue9944882 Any ETA for this PR? If there is anything we can do to move it forward please let us know. |
Because io.kubernetes client 13.0.0 keeps reinstalling the watch on expired resources. Fixes micronaut-projects#374, until kubernetes-client/java#1628 gets released.
/hold cancel |
/close picked and merged #1927 |
@yue9944882: Closed this PR. 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. |
Related Issues:
Related PRs