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

Fix windows performance counter error on Non-English environemnt #84156

Merged
merged 1 commit into from Oct 23, 2019

Conversation

wawa0210
Copy link
Contributor

@wawa0210 wawa0210 commented Oct 21, 2019

/kind bug

What this PR does / why we need it:
This issue can cause the kubelet not to start properly and cannot provide services.

The ValidatePath syscall only operates in a localized language mode,
however AddEnglishCounter always works with English-localized counter
names. This means that on non-English systems, the counter will work but
will fail validation.

The only solution is to not validate the counter. There is no
corresponding ValidateEnglishPath syscall. CollectQueryData will
still error if the counter is invalid.

Reference: influxdata/telegraf#2261

This is the official example of Microsoft npd, and also does not need to call the PdhValidatePath method.
https://docs.microsoft.com/en-us/windows/win32/perfctrs/browsing-performance-counters

Which issue(s) this PR fixes:

Fixes #74173

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Fix kubelet metrics gathering on non-English Windows hosts

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


/sig windows

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 21, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @wawa0210. 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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. labels Oct 21, 2019
@wawa0210
Copy link
Contributor Author

@benmoss Can you review this pr

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 21, 2019
@benmoss
Copy link
Member

benmoss commented Oct 21, 2019

/approve
/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 21, 2019
@benmoss
Copy link
Member

benmoss commented Oct 21, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 21, 2019
@wawa0210 wawa0210 changed the title fix windows performance counter error on Non-English environemnt Fix windows performance counter error on Non-English environemnt Oct 21, 2019
@daschott
Copy link
Contributor

FYI @PatrickLang

@dashpole
Copy link
Contributor

/uncc
I don't think I can provide a useful review here.
/cc @yujuhong

@k8s-ci-robot k8s-ci-robot requested review from yujuhong and removed request for dashpole October 22, 2019 15:37
@yujuhong
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benmoss, wawa0210, yujuhong

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 Oct 22, 2019
@wawa0210
Copy link
Contributor Author

@wawa0210
Copy link
Contributor Author

wawa0210 commented Oct 22, 2019

@benmoss @yujuhong @PatrickLang

Since this issue exists in all historical versions and will cause non-English versions of windows kubelets to not work properly, do I need to cherry-pick to 1.14, 1.15, 1.16 at the same time? I can go to cherry-pick if needed.

@k8s-ci-robot k8s-ci-robot merged commit 6d314f8 into kubernetes:master Oct 23, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Oct 23, 2019
@wawa0210 wawa0210 deleted the win-performance-counter branch October 23, 2019 03:14
@benmoss
Copy link
Member

benmoss commented Oct 24, 2019

Yes, I think if you want to you should cherry-pick this to other versions. There's documentation on this process here https://github.com/kubernetes/community/blob/master/contributors/devel/sig-release/cherry-picks.md

@wawa0210
Copy link
Contributor Author

Yes, I think if you want to you should cherry-pick this to other versions. There's documentation on this process here https://github.com/kubernetes/community/blob/master/contributors/devel/sig-release/cherry-picks.md

Done, can you help me review these cherry-picks?

k8s-ci-robot added a commit that referenced this pull request Nov 9, 2019
…56-upstream-release-1.16

Automated cherry pick of #84156: fix windows performance counter father information failed
k8s-ci-robot added a commit that referenced this pull request Nov 9, 2019
…56-upstream-release-1.14

Automated cherry pick of #84156: fix windows performance counter father information failed
k8s-ci-robot added a commit that referenced this pull request Nov 9, 2019
…56-upstream-release-1.15

Automated cherry pick of #84156: fix windows performance counter father information failed
@PatrickLang PatrickLang added this to Done (v1.17) in SIG-Windows Dec 6, 2019
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. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kubelet: unable to valid path to counter. Error code is c0000bb8
6 participants