Truncate verbose DEBUG log payloads to reduce heap pressure#1041
Merged
pditommaso merged 1 commit intomasterfrom May 9, 2026
Merged
Truncate verbose DEBUG log payloads to reduce heap pressure#1041pditommaso merged 1 commit intomasterfrom
pditommaso merged 1 commit intomasterfrom
Conversation
Container provisioning and Tower client paths interpolate full ContainerRequest/ContainerLayer/ProxyHttpResponse objects into DEBUG log lines. Inline `data:` URI layers and full Tower headers can each produce log strings hundreds of KB long, allocating humongous regions in the JVM heap and amplifying GC pressure under traffic bursts. - ContainerRequest.toString(): truncate containerConfig to 500 chars (covers all 9 call sites that interpolate \$request). - ContainerAugmenter: log layer digest+size instead of full layer. - TowerConnector: DEBUG logs only msgId/status/body (truncated 500); full headers/body remain available at TRACE. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
data:URI container layers and full Tower response headers/bodies were being interpolated into DEBUG log lines, producing log strings hundreds of KB long. Under registry-proxy traffic bursts these allocate humongous G1 regions and amplify GC pressure (observed alongside the recent OOMKill events onwave-prod).ContainerRequest.toString()now truncatescontainerConfigto 500 chars — fixes all 9 call sites that interpolate$requestin one place.ContainerAugmenter.layerBloblogsgzipDigest+gzipSizeinstead of the fullContainerLayer(which can carry adata:URI body).TowerConnectorDEBUG paths now log onlymsgId/statusplus a 500-char truncated body. Full headers and full body are kept available atTRACE(single emit, no consecutive log lines).Test plan
./gradlew testpasses locallycontainerConfiglog entries are short anddata:URI bodies no longer appearmsgId; status; body=…and not full CSP/Set-Cookie header dumps🤖 Generated with Claude Code