mirror of
https://github.com/Telmate/proxmox-api-go.git
synced 2026-04-25 23:45:55 +03:00
[PR #250] [MERGED] Don't include large req/resp bodies (>5 Mb) in debug output #341
Labels
No labels
good first issue
issue/confirmed
issue/critical
proposal/accepted
pull-request
type/bug
type/enhancement
type/feature
type/question
type/refactoring
type/testing
type/testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmox-api-go#341
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Telmate/proxmox-api-go/pull/250
Author: @mollstam
Created: 3/29/2023
Status: ✅ Merged
Merged: 3/29/2023
Merged by: @mleone87
Base:
master← Head:fix/debug-output-truncate-large-bodies📝 Commits (1)
b287d45Don't include large req/resp bodies (>5 Mb) in debug output📊 Changes
1 file changed (+12 additions, -2 deletions)
View changed files
📝
proxmox/session.go(+12 -2)📄 Description
I was debug logging when my code was uploading a 4.3 Gb iso file and my debug output just exploded and the container went OOM (this last part could potentially be mitigated by
GOMEMLIMIT, not sure).While not incorrect behaviour, printing a couple of gigabytes of binary into the log as part of the
POSTrequest dump wasn't exactly helpful, so I made the client invokehttputil.DumpRequestOutetc without asking for body output in case body was "too large". Now log is useful again, and not creating a bunch of garbage in memory either.An alternative approach would be to cut off the body at some point instead, and/or to make it configurable.
Not sure it's something you want, but thought I'd submit it for your consideration. :-)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.