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
Ignore transient errors when gathering stats for Windows Containers in Dockershim #98510
Ignore transient errors when gathering stats for Windows Containers in Dockershim #98510
Conversation
/priority critical-urgent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/triage accepted
LGTM but I'm not a windows person :)
/assign @marosset |
02ab72e
to
1e696b1
Compare
looks like
/retest |
looks like the azure disk is known issue: #98492 |
/test pull-kubernetes-e2e-azure-disk-windows |
// This is transient; skip container for now | ||
// These hcs errors do not have helpers exposed in public package so need to query for the known codes: | ||
// https://github.com/microsoft/hcsshim/blob/master/internal/hcs/errors.go | ||
klog.Errorf("Container is not in a state that stats can be accessed '%s': %v. This occurs when the container is created but not started.", containerID, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this an info message since nothing is actually wrong and there is nothing actionable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was following the same pattern as above
kubernetes/pkg/kubelet/dockershim/docker_stats_windows.go
Lines 41 to 43 in 4a8b2d3
if !hcsshim.IsNotExist(err) && !hcsshim.IsAlreadyStopped(err) { | |
klog.Errorf("Error opening container (stats will be missing) '%s': %v", containerID, err) | |
} |
If we do that here I think we should do it there too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's update both messages to log as Info at V(4).
That matches some similar logs messages i'm seeing in dockershim
klog.V(4).Infof("Unable to convert docker to runtime API container: %v", err) |
@ehashman any concerns or comments with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we're not yet on structured logging in this file yet but I don't think there's any issue with changing this to an Info, the current guidance is that expected errors are fine to log at the info level: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#using-errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated to log using info
1e696b1
to
3da0d99
Compare
/lgtm |
/milestone v1.21 |
/test pull-kubernetes-e2e-azure-disk-windows |
@ehashman this is ready for final approval |
@ehashman I see you are not the approver for this sorry! /assign @dchen1107 @derekwaynecarr |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsturtevant, marosset, mrunalp 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 |
@jsturtevant Thanks for fixing this issue. Do you have a plan to backport this fix to earlier versions since lots of users are hitting this issue? |
…#98510-upstream-release-1.20 Automated cherry pick of #98510: Ignore transient errors when gather stats
…#98510-upstream-release-1.19 Automated cherry pick of #98510: Ignore transient errors when gather stats
What type of PR is this?
/kind bug
What this PR does / why we need it:
When a Windows container is started by docker there is a case when stats may be accessed before the container is started causing errors.
Which issue(s) this PR fixes:
Fixes #98509
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/sig windows