Uh oh!
There was an error while loading. Please reload this page.
Retry expired watches - #133
Conversation
mitar
commented
May 12, 2019
Codecov Report
@@ Coverage Diff @@## master #133 +/- ##
==========================================
- Coverage 92.86% 92.62% -0.24%
==========================================
Files 13 13 Lines 1345 1356 +11 ==========================================
+ Hits 1249 1256 +7 - Misses 96 100 +4
Continue to review full report at Codecov.
|
ccamacho
commented
Jun 29, 2019
It would be nice to have those 3 commits squashed into 1 |
mitar
commented
Jun 29, 2019
Doesn't GitHub support that when merging the PR? |
micw523
commented
Jun 29, 2019
via email
Manually yes, but we’re using bots to merge the commits so usually the commits need to be squashed. … 在 2019年6月29日,01:01,Mitar ***@***.***> 写道:
Doesn't GitHub support that when merging the PR?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread. |
mitar
commented
Jun 29, 2019
Done. |
roycaihw
commented
Jul 30, 2019
/cc |
| yield self.unmarshal_event(line, return_type) | ||
| event = self.unmarshal_event(line, return_type) | ||
| if isinstance(event, dict) and event['type'] == 'ERROR': | ||
| obj = event['raw_object'] |
There was a problem hiding this comment.
Is it safe to assume the APIs won't change for accessing event['raw_object']['code'], @roycaihw ?
There was a problem hiding this comment.
The contract is that apiserver will always send a watch event of ERROR type with object of metav1.Status type.
We can check if the dict has the key code and handle non-existence like what client-go does
roycaihw
left a comment
There was a problem hiding this comment.
looks good in general. One major question about the retry behavior
| yield self.unmarshal_event(line, return_type) | ||
| event = self.unmarshal_event(line, return_type) | ||
| if isinstance(event, dict) and event['type'] == 'ERROR': | ||
| obj = event['raw_object'] |
There was a problem hiding this comment.
The contract is that apiserver will always send a watch event of ERROR type with object of metav1.Status type.
We can check if the dict has the key code and handle non-existence like what client-go does
| # but only if we have not already retried. | ||
| if not retry_after_410 and obj['code'] == 410: | ||
| retry_after_410 = True | ||
| break |
There was a problem hiding this comment.
we should not retry the watch request with the same RV when it's already gone in apiserver
we can retry on 500 and 504 according to the client-go implementation
There was a problem hiding this comment.
@yliaog pointed out that we need to be careful about the code structure here. We want to be consistent to kubernetes client-go in terms of what a watch is capable of doing
- In client-go, a watch function call doesn't retry on err. A client can implement their own handling for watch errors
- client-go provides tooling like informer and retrywatcher for clients to leverage, which have retry logics for watch errors
We should be consistent and provide the same choices to our user
There was a problem hiding this comment.
But that would be backwards incompatible with current offering by Python package? It already supports retrying. So I think for Python it seems we already made decision that watch is retrying.
| return data | ||
| js['raw_object'] = js['object'] | ||
| if return_type: | ||
| if return_type and js['type'] != 'ERROR': |
There was a problem hiding this comment.
this is where we fail to deserialize the response. Good catch
dmateusp
commented
Nov 18, 2019
is this good to go ? |
jinchihe
commented
Dec 19, 2019
Can someone review and approve the PR? we meet the problem now... Thanks. |
fejta-bot
commented
Mar 18, 2020
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
mitar
commented
Mar 18, 2020
/remove-lifecycle stale |
mel1nn
commented
May 12, 2020
Could you fix the merge conflict please ? |
codecov-commenter
commented
May 27, 2020
Codecov Report
@@ Coverage Diff @@## master #133 +/- ##
==========================================
- Coverage 92.69% 92.50% -0.20%
==========================================
Files 13 13 Lines 1519 1547 +28 ==========================================
+ Hits 1408 1431 +23 - Misses 111 116 +5
Continue to review full report at Codecov.
|
mitar
commented
May 27, 2020
Done. |
mitar
commented
Jun 23, 2020
I have updated this. Please review it before it gets rotten again. |
mel1nn
commented
Jun 29, 2020
mel1nn
commented
Jul 15, 2020
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
yliaog
commented
Jul 15, 2020
thanks for the PR. /lgtm |
k8s-ci-robot
commented
Jul 15, 2020
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mitar, yliaog The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
PR kubernetes-client#133 introduces the usage of `http` module for checking the status code for `GONE` HTTP status. However, this doesn't work in Python 2.7. This commit checks if the interpreter is Python 2 and imports the status code from `httplib` module instead and unifies the approach to the checks. Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
This is a followup to #102 and fixes#57.