-
Notifications
You must be signed in to change notification settings - Fork 1.1k
WIP: Add an endpoint for heap dumps #5197
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
Conversation
This is to aid inspecting memory usage Signed-off-by: Mrunal Patel <[email protected]>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrunalp The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5197 +/- ##
==========================================
- Coverage 44.27% 44.22% -0.05%
==========================================
Files 112 112
Lines 11563 11576 +13
==========================================
Hits 5119 5119
- Misses 5957 5969 +12
- Partials 487 488 +1 |
|
|
||
| debug.WriteHeapDump(f.Fd()) | ||
|
|
||
| if _, err := w.Write([]byte(fmt.Sprintf("Wrote crio heapdump to %q. Please move it to avoid using memory.\n", dumpFilePath))); err != nil { |
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.
opt.semgrep.no-printf-in-responsewriter: Detected printf or similar in http.ResponseWriter.write().
This bypasses HTML escaping that prevents cross-site scripting
vulnerabilities. Instead, use the 'html/template' package
to render data to users.
(at-me in a reply with help or ignore)
| if enableProfile { | ||
| mux.Get("/debug/dumpheap", http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { | ||
| dumpFilePath := filepath.Join("/tmp", fmt.Sprintf( | ||
| "crio-heapdump-%s.out", |
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.
Idea: Add a subcommand to crio-status to dump to a specific file location.
|
A friendly reminder that this PR had no activity for 30 days. |
|
do we still want this @mrunalp @saschagrunert |
Yep, I think so! 😊 |
|
@mrunalp: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
@cri-o/cri-o-maintainers We still require this. Can we consider opening it as a "good-first-issue" to encourage external contributions? |
|
good idea! |
|
Closing this in favor of #7307 |
This is to aid inspecting memory usage
Signed-off-by: Mrunal Patel [email protected]
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds support to get crio heap dumps for inspecting memory usage.
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Does this PR introduce a user-facing change?