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

Add more info to the ListAndWatch trace #105819

Merged
merged 1 commit into from Nov 3, 2021

Conversation

tosi3k
Copy link
Member

@tosi3k tosi3k commented Oct 21, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:

During scalability tests we sometimes run into issues where the kube-apiserver says it has quickly responded to the list-and-watch client but the client times out during waiting for the list response resulting in a trace like this:

Trace[1278792655]: "Reflector ListAndWatch" name:*v1.PodStore: namespace(test-c4fygz-19), labelSelector(name=latency-deployment-87) (started: 2021-10-15 09:15:15.677742785 +0000 UTC m=+3349.793617611) (total time: 2m0.000883547s):
Trace[1278792655]: [2m0.000883547s] [2m0.000883547s] END

This change is to increase the debuggability so we know what is the actual culprit visible from the client point of view

Which issue(s) this PR fixes:

No issue is opened for that.

Special notes for your reviewer:

/sig scalability
/assign @mborsz

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. sig/scalability Categorizes an issue or PR as relevant to SIG Scalability. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Oct 21, 2021
@fedebongio
Copy link
Contributor

/assign @caesarxuchao
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 21, 2021
@@ -319,6 +319,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
panic(r)
case <-listCh:
}
initTrace.Step("Objects listed", trace.Field{"error", err})
if err != nil {
return fmt.Errorf("failed to list %v: %v", r.expectedTypeName, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to add the trace, should we also make sure the caller of ListAndWatch logs the err? Trace is only printed if the function takes more than 10s, https://github.com/kubernetes/kubernetes/blob/8c8ec9071c35a462b90f545fd39aaa92aa80b9aa/staging/src/k8s.io/client-go/tools/cache/reflector.go#L262

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mborsz
Copy link
Member

mborsz commented Oct 29, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 29, 2021
@caesarxuchao
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: caesarxuchao, tosi3k

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 3, 2021
@k8s-ci-robot k8s-ci-robot merged commit 63c4a22 into kubernetes:master Nov 3, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/scalability Categorizes an issue or PR as relevant to SIG Scalability. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants