cri_stats: handle missing cpu stats#7198
Conversation
|
Hi @endocrimes. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
thanks! Please use git commit -s to sign off~ |
Signed-off-by: Danielle Lancashire <[email protected]>
91c4ec8 to
3125f7e
Compare
|
/ok-to-test |
|
@fuweid Done - lack of habit, sorry! |
dcantah
left a comment
There was a problem hiding this comment.
One small suggestion. LGTM on green also, thanks! Windows failure looks unrelated if anyone's able to reschedule the run.
|
restarted the failed jobs |
|
Thanks @endocrimes! Sorry I missed this! |
|
@jsturtevant no worries - it's an easy mistake to make, the "it doesn't have stats" case was not super explicit before 😅 |
|
just for history, our nightly windows CI hit this as well: https://prow.k8s.io/view/gs/kubernetes-jenkins/logs/ci-kubernetes-e2e-capz-master-containerd-nightly-windows/1550549379679522816 |
#7186 changed how container cpu stats are populated. Previously, UsageNanoCores were computed at the same time as populating UsageCoreNanoSeconds, and only when UsageCoreNanoSeconds could be populated.
After the change however, we attempt to compute UsageNanoCore's regardless of the state of the provided metrics. This can panic in cases where we do not yet have CPU stats (e.g if the container did not start).
This change restores the previous behavior, by skipping the computation if cpu metrics are unavailable.