Skip to content

SOLR-18168: Simplify JettySolrRunner#4262

Open
dsmiley wants to merge 1 commit intoapache:mainfrom
dsmiley:SimplifyJettySolrRunner2
Open

SOLR-18168: Simplify JettySolrRunner#4262
dsmiley wants to merge 1 commit intoapache:mainfrom
dsmiley:SimplifyJettySolrRunner2

Conversation

@dsmiley
Copy link
Copy Markdown
Contributor

@dsmiley dsmiley commented Apr 3, 2026

(1) Remove GzipHandler from JettySolrRunner. The testCompression test in BasicHttpSolrClientTest verified that Solr's Jetty server responds with gzip-encoded content when the client sends Accept-Encoding: gzip. This behavior belongs in an integration test against the real packaged server, not the embedded test Jetty.

  • Add solr/packaging/test/test_compression.bats with three tests: server omits Content-Encoding without Accept-Encoding header, server includes Content-Encoding: gzip when requested, and curl can decompress and parse the response end-to-end.
  • Remove the GzipHandler setup from JettySolrRunner (it was already commented out with a TODO pointing here).
  • Remove testCompression from BasicHttpSolrClientTest.

(2) Refactor JettySolrRunner filter access to use generic getFilter()

Replace specific filter accessors (getDebugFilter, getSolrRateLimitFilter) with a single generic getFilter(Class) method. Update call sites in ShardRoutingTest and TestInPlaceUpdatesDistrib to register DebugFilter via getExtraRequestFilters() rather than relying on it being added automatically. Broaden getExtraRequestFilters() return type from SortedMap to SequencedMap.

(3) remove Servlet404.

https://issues.apache.org/jira/browse/SOLR-18168 -- not totally same but follow-on

The testCompression test in BasicHttpSolrClientTest verified that Solr's
Jetty server responds with gzip-encoded content when the client sends
Accept-Encoding: gzip. This behavior belongs in an integration test against
the real packaged server, not the embedded test Jetty.

- Add solr/packaging/test/test_compression.bats with three tests:
  server omits Content-Encoding without Accept-Encoding header,
  server includes Content-Encoding: gzip when requested, and
  curl can decompress and parse the response end-to-end.
- Remove the GzipHandler setup from JettySolrRunner (it was already
  commented out with a TODO pointing here).
- Remove testCompression from BasicHttpSolrClientTest.

Refactor JettySolrRunner filter access to use generic getFilter()

Replace specific filter accessors (getDebugFilter, getSolrRateLimitFilter)
with a single generic getFilter(Class) method. Update call sites in
ShardRoutingTest and TestInPlaceUpdatesDistrib to register DebugFilter via
getExtraRequestFilters() rather than relying on it being added automatically.
Broaden getExtraRequestFilters() return type from SortedMap to SequencedMap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant