[PR #250] [MERGED] Don't include large req/resp bodies (>5 Mb) in debug output #341

Closed
opened 2026-02-28 00:41:49 +03:00 by kerem · 0 comments
Owner

📋 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: masterHead: fix/debug-output-truncate-large-bodies


📝 Commits (1)

  • b287d45 Don'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 POST request dump wasn't exactly helpful, so I made the client invoke httputil.DumpRequestOut etc 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.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/250 **Author:** [@mollstam](https://github.com/mollstam) **Created:** 3/29/2023 **Status:** ✅ Merged **Merged:** 3/29/2023 **Merged by:** [@mleone87](https://github.com/mleone87) **Base:** `master` ← **Head:** `fix/debug-output-truncate-large-bodies` --- ### 📝 Commits (1) - [`b287d45`](https://github.com/Telmate/proxmox-api-go/commit/b287d45fd69716f45f3505d3fa7531265fdddc06) Don't include large req/resp bodies (>5 Mb) in debug output ### 📊 Changes **1 file changed** (+12 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/session.go` (+12 -2) </details> ### 📄 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 `POST` request dump wasn't exactly helpful, so I made the client invoke `httputil.DumpRequestOut` etc 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. :-) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:41:49 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#341
No description provided.