Skip to content

Compress negotiated admin query responses - #2925

Merged
stopachka merged 1 commit into
mainfrom
codex/admin-query-compression
Sep 21, 2026
Merged

stopachka merged 1 commit into
mainfrom
codex/admin-query-compression

Conversation

@stopachka

Copy link
Copy Markdown
Contributor

Large /admin/query JSON 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, and no-transform. The admin-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.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ce8b333a-0154-45e7-887c-7cf788c4a469

📥 Commits

Reviewing files that changed from the base of the PR and between a5af1e9 and 8d827e3.

📒 Files selected for processing (3)
  • server/src/instant/core.clj
  • server/src/instant/lib/ring/compression.clj
  • server/test/instant/lib/ring/compression_test.clj

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The server adds conditional gzip compression for eligible POST /admin/query JSON responses. The feature is controlled by a runtime flag and includes tests for negotiation, headers, response boundaries, streaming, and large payloads.

Changes

Admin Query Compression

Layer / File(s) Summary
Compression rules and handler
server/src/instant/lib/ring/compression.clj
Adds response eligibility checks, Vary header merging, and conditional gzip encoding for qualifying admin query responses.
Server handler wiring
server/src/instant/core.clj
Wraps Undertow handlers with compression when :admin-query-compression? is enabled.
Compression integration tests
server/test/instant/lib/ring/compression_test.clj
Tests gzip negotiation, headers, runtime toggling, boundary cases, bypass conditions, streams, and large responses.

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: gzip compression for negotiated admin query responses.
Description check ✅ Passed The description directly explains the /admin/query compression behavior, runtime toggle, exclusions, validation, and deployment intent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@stopachka
stopachka merged commit 94b167f into main Sep 21, 2026
33 checks passed
@stopachka
stopachka deleted the codex/admin-query-compression branch September 21, 2026 16:56
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