Skip to content

Truncate verbose DEBUG log payloads to reduce heap pressure#1041

Merged
pditommaso merged 1 commit intomasterfrom
truncate-verbose-debug-logs
May 9, 2026
Merged

Truncate verbose DEBUG log payloads to reduce heap pressure#1041
pditommaso merged 1 commit intomasterfrom
truncate-verbose-debug-logs

Conversation

@pditommaso
Copy link
Copy Markdown
Collaborator

Summary

  • Inline 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 on wave-prod).
  • ContainerRequest.toString() now truncates containerConfig to 500 chars — fixes all 9 call sites that interpolate $request in one place.
  • ContainerAugmenter.layerBlob logs gzipDigest+gzipSize instead of the full ContainerLayer (which can carry a data: URI body).
  • TowerConnector DEBUG paths now log only msgId/status plus a 500-char truncated body. Full headers and full body are kept available at TRACE (single emit, no consecutive log lines).

Test plan

  • ./gradlew test passes locally
  • Spot-check DEBUG output in a stage env: confirm containerConfig log entries are short and data: URI bodies no longer appear
  • Spot-check Tower DEBUG entries show msgId; status; body=… and not full CSP/Set-Cookie header dumps
  • Bumping logger to TRACE still produces the full headers/body dump

🤖 Generated with Claude Code

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>
@pditommaso pditommaso merged commit ac708f0 into master May 9, 2026
4 checks passed
@pditommaso pditommaso deleted the truncate-verbose-debug-logs branch May 9, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant