Compress negotiated admin query responses - #2925
Conversation
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe server adds conditional gzip compression for eligible ChangesAdmin Query Compression
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Client
participant AdminQueryHandler
participant CompressionWrapper
participant UndertowEncodingHandler
Client->>AdminQueryHandler: POST /admin/query
AdminQueryHandler->>CompressionWrapper: Process request when enabled
CompressionWrapper->>UndertowEncodingHandler: Evaluate response for gzip
UndertowEncodingHandler-->>Client: Return compressed or unchanged response
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Large
/admin/queryJSON responses currently cross the load balancer uncompressed. Compress successful responses of at least 1 KiB when the client accepts gzip, reducing origin traffic and ALB processed bytes without an SDK change.Use Undertow's streaming gzip at level 1, preserve
Vary, and honor encoding negotiation, existing encodings, andno-transform. Theadmin-query-compression?runtime toggle defaults to false for a controlled rollout. Other routes, SSE, and WebSockets keep their existing behavior.Validation: 4 local HTTP integration tests with 74 assertions passed, covering Unicode, transparent client decoding, identity negotiation, the size threshold, exclusions, runtime disable, large response framing, and graceful shutdown. Lint passed; independent protocol review found no issues.
Deployment will layer this change on the currently serving release so the recent query and cost fixes remain intact, then enable the toggle after origin and edge verification.