Skip to content
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 watchHandler: make 'The resourceVersion for ... watch is too old' log Info not Warning #78991

Merged

Conversation

@sallyom
Copy link
Contributor

commented Jun 13, 2019

What type of PR is this?
logging Warning to Info - not sure what /kind

What this PR does / why we need it:
This warning comes from Reflector watchHandler, from the apiserver error that indicates a watch was restarted. This happens when etcd drops the connection and resources are relisted. This informs the user that the watchers are operating properly, so should be logged as Info rather than Warning.

Reflector watchHandler Warning log 'The resourceVersion for the provided watch is too old.' is now logged as Info. 
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

Welcome @sallyom!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

Hi @sallyom. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@enj

This comment has been minimized.

Copy link
Member

commented Jun 13, 2019

/kind cleanup
/ok-to-test
/lgtm

@enj

This comment has been minimized.

Copy link
Member

commented Jun 13, 2019

/priority important-soon

@sallyom

This comment has been minimized.

Copy link
Contributor Author

commented Jun 13, 2019

this is my first k8s PR, I think this should be noted 🎉

@enj

This comment has been minimized.

Copy link
Member

commented Jun 13, 2019

this is my first k8s PR, I think this should be noted 🎉

The bot totally did notice: #78991 (comment)

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Jun 13, 2019
@sallyom

This comment has been minimized.

Copy link
Contributor Author

commented Jun 13, 2019

/assign @sttts

@fedebongio

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

/assign @jingyih

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

@fedebongio: GitHub didn't allow me to assign the following users: jingyih.

Note that only kubernetes members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @jingyih

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.

@fedebongio

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

/assign @roycaihw

@sallyom sallyom force-pushed the sallyom:reflector-too-old-warning-info branch from 8c355b3 to ef1a79b Jun 13, 2019
@sallyom sallyom force-pushed the sallyom:reflector-too-old-warning-info branch from ef1a79b to 1dba58b Jun 13, 2019
@sallyom sallyom changed the title Modify etcd error '...resourceVersion... is too …old' to be Info instead of Warning in Reflector watchHandler Reflector watchHandler: make 'The resourceVersion for ... watch is too old' log Info not Warning Jun 14, 2019
@sallyom sallyom force-pushed the sallyom:reflector-too-old-warning-info branch from 1dba58b to b7c1a75 Jun 14, 2019
@@ -78,6 +78,7 @@ var (
// We try to spread the load on apiserver by setting timeouts for
// watch requests - it is random in [minWatchTimeout, 2*minWatchTimeout].
minWatchTimeout = 5 * time.Minute
ErrStaleWatch = apierrs.NewResourceExpired("The resourceVersion for the provided watch is too old.")

This comment has been minimized.

Copy link
@yue9944882

yue9944882 Jun 14, 2019

Member

return nil, errors.NewGone(fmt.Sprintf("too old resource version: %d (%d)", resourceVersion, oldest-1))

consider reuse the error for the watch-cache?

This comment has been minimized.

Copy link
@sttts

sttts Jun 14, 2019

Contributor

I fear we cannot access that here from client-go.

case errorStopRequested:
// no extra log message
case ErrStaleWatch:
klog.V(1).Infof("%s: watch of %v ended with: %v", r.name, r.expectedType, err)

This comment has been minimized.

Copy link
@sttts

sttts Jun 14, 2019

Contributor

would even go higher with the verbosity level. 4 maybe. So it is hidden normally.

This comment has been minimized.

Copy link
@sallyom

sallyom Jun 14, 2019

Author Contributor

done, made it a 4

switch err {
case errorStopRequested:
// no extra log message
case ErrStaleWatch:

This comment has been minimized.

Copy link
@sttts

sttts Jun 14, 2019

Contributor

this compares the human readable message (next to anything else of the error). If you look what the error actually is:

	return &StatusError{metav1.Status{
		Status:  metav1.StatusFailure,
		Code:    http.StatusGone,
		Reason:  metav1.StatusReasonExpired,
		Message: message,
	}}

we should probably just compare the reason (meant to be machine readable). There is even a func IsResourceExpired for that. Then you also don't have to export the ErrStaleWatch from here, and we avoid coupling of our client library with some low level storage library for etcd.

This comment has been minimized.

Copy link
@sallyom

sallyom Jun 14, 2019

Author Contributor

thanks! much better, I did not see that, now I know :)

…o old' to Info.

This warning comes from Reflector watchHandler, from the apiserver error that
indicates a watch was restarted.  This happens when etcd drops the connection
and resources are relisted.  This informs the user that the watchers are
operating properly, so should be logged as Info rather than Warning.
@sallyom sallyom force-pushed the sallyom:reflector-too-old-warning-info branch from b7c1a75 to a953d15 Jun 14, 2019
@k8s-ci-robot k8s-ci-robot added size/XS and removed size/S labels Jun 14, 2019
@sttts

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm label Jun 14, 2019
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sallyom, sttts

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fejta-bot

This comment has been minimized.

Copy link

commented Jun 14, 2019

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 1a15ce1 into kubernetes:master Jun 15, 2019
23 checks passed
23 checks passed
cla/linuxfoundation sallyom authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-iscsi Skipped.
pull-kubernetes-e2e-gce-iscsi-serial Skipped.
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
@sallyom sallyom referenced this pull request Sep 12, 2019
6 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.