-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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
#50102 Task 3: Until, backed by retry watcher #67350
Conversation
7ff610e
to
09d5b96
Compare
ping, curious if any progress is being planned for this release cycle |
/skip |
09d5b96
to
5da92f8
Compare
6dd7303
to
363ae00
Compare
/milestone v1.14 |
0854316
to
f048308
Compare
f048308
to
f1d4df8
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, tnozicka The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@liggitt thank you for reviewing this in detail! |
moving the ResultChan close has confused unit test, fixed: diff --git a/staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go b/staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go
index 7e09fa953e..cd57e51c52 100644
--- a/staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go
+++ b/staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go
@@ -541,8 +541,10 @@ func TestRetryWatcher(t *testing.T) {
// but have to tolerate some delay. Given this is best effort detection we can use short duration.
// It also makes sure that for 0 events the watchFunc has time to be called.
select {
- case event := <-watcher.ResultChan():
- t.Error(spew.Errorf("Unexpected event received after reading all the expected ones: %#+v", event))
+ case event, ok := <-watcher.ResultChan():
+ if ok {
+ t.Error(spew.Errorf("Unexpected event received after reading all the expected ones: %#+v", event))
+ }
case <-time.After(10 * time.Millisecond):
break
} |
f1d4df8
to
d526dad
Compare
/lgtm |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
Is this a flake? #56876 (comment) (can't reproduce locally) Edit: just to be clear, this is not flaking on k/k's master... https://testgrid.k8s.io/sig-release-master-blocking#integration-master is green :) |
yes, looks like there are some races: go test ./vendor/k8s.io/client-go/tools/watch -run TestRetryWatcher -count 1000 -race -v -failfast produced at least these failures:
|
I'll fix send a fix shortly, it's a race in the unit tests when counting the watch calls (the last one is theoretically optional based on timing). Looks like I've used too small |
fix is in #74663 |
What this PR does / why we need it:
This is a split off from #50102 to go in smaller pieces.
Introduces Until based on RetryWatcher. It can survive closed watches if last read ResourceVersion is still present in etcd.
Fixes: #31345
Requires:
/hold
Release note:
/priority important-soon
/kind bug
(bug after the main PR which is this split from)