You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Send a request to shim with timeout. Default to 2 seconds.
I repeat the same steps to verify. After the fix, containerd daemon returns Prometheus metrics even when one of the shim hangs, containerd logs show a request timeout to stat:
I'm waiting for a containerd 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.
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.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
containerd/metrics/cgroups/v2/metrics.go
Line 118 in d3aa7ee
containerd/metrics/cgroups/v1/metrics.go
Line 125 in d3aa7ee
If the shim process is not responsive, the request blocks there,
Collect.Collect()
blocks.containerd/metrics/cgroups/v2/metrics.go
Line 92 in d3aa7ee
This causes leaked goroutines and memory. Requests to prometheus metrics /v1/metrics to hangs when there is a "bad shim"
Reproducing
I launched a container with a mock shim implementation that hangs on Stats: phanhuyn@a6add78
Observe request to prometheus endpoint hangs
curl localhost:8080/v1/metrics # hangs
Stats
call to the shim processFix
Timeout setting
The default timeout is set to 2 seconds. Can be configured by:
Signed-off-by: Nguyen Phan Huy phanhuy1502@gmail.com