-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jetty12 + EE10 #2876
base: main
Are you sure you want to change the base?
Jetty12 + EE10 #2876
Conversation
This should link to https://issues.apache.org/jira/browse/SOLR-17069 and potentially #1509 |
gradle/libs.versions.toml
Outdated
@@ -305,7 +306,7 @@ commonsio-commonsio = { module = "commons-io:commons-io", version.ref = "commons | |||
cybozulabs-langdetect = { module = "com.cybozu.labs:langdetect", version.ref = "cybozulabs-langdetect" } | |||
dropwizard-metrics-core = { module = "io.dropwizard.metrics:metrics-core", version.ref = "dropwizard-metrics" } | |||
dropwizard-metrics-graphite = { module = "io.dropwizard.metrics:metrics-graphite", version.ref = "dropwizard-metrics" } | |||
dropwizard-metrics-jetty10 = { module = "io.dropwizard.metrics:metrics-jetty10", version.ref = "dropwizard-metrics" } | |||
dropwizard-metrics-jetty10 = { module = "io.dropwizard.metrics:metrics-jetty12-ee10", version.ref = "dropwizard-metrics" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it matter that this is ee10 vs ee8 like the description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also the key should change from dropwizard-metrics-jetty10
KNOWN_MIME_TYPES.add("text/xml"); | ||
KNOWN_MIME_TYPES.add("text/javascript"); | ||
KNOWN_MIME_TYPES.add("text/csv"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did csv/xhtml get added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting from Jetty 11 these two mime types are not included in MimeTypes.Type
, but we have tests that check if they are supported. Not sure if this could cause any issues with jetty though.
solr/core/src/test/org/apache/solr/cloud/OverseerStatusTest.java
Outdated
Show resolved
Hide resolved
solr/test-framework/src/java/org/apache/solr/embedded/JettySolrRunner.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
chain = injectJettyHandlers(chain); | ||
|
||
if (config.enableV2) { | ||
RewriteHandler rwh = new RewriteHandler(); | ||
rwh.setHandler(chain); | ||
rwh.setRewriteRequestURI(true); | ||
rwh.setRewritePathInfo(false); | ||
// rwh.setRewriteRequestURI(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented out?
|
s3mock was a problem when I last looked at Jetty 11/12 due to it needing to stay on 2.x due to Java 17 required in 3.x. However, now that we are on JDK 17 on main, we should be able to upgrade to s3mock 3.x - https://github.com/adobe/S3Mock/releases/tag/3.0.0 (latest being https://github.com/adobe/S3Mock/releases/tag/3.11.0) I wonder if that will address the Jetty incompatibilities since this upgraded Spring as well. This upgrade of s3mock should be done separately from any Jetty upgrade if possible. |
@@ -138,7 +139,7 @@ jayway-jsonpath = "2.9.0" | |||
jctools = "4.0.5" | |||
jersey = "3.1.9" | |||
# TODO Sync with jersey versions | |||
jersey-containers = "2.39.1" | |||
jersey-containers = "3.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go with jersey version 3.1.9 if possible, so that we can remove this entry completely (see line above).
KNOWN_MIME_TYPES.add("text/xml"); | ||
KNOWN_MIME_TYPES.add("text/javascript"); | ||
KNOWN_MIME_TYPES.add("text/csv"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting from Jetty 11 these two mime types are not included in MimeTypes.Type
, but we have tests that check if they are supported. Not sure if this could cause any issues with jetty though.
solr/core/src/test/org/apache/solr/util/tracing/TestHttpServletRequestGetter.java
Outdated
Show resolved
Hide resolved
For S3Mock, the library is upgraded to support Jetty12. Test cases are running now! For s3mock to deal in separate PR, I tried to maintain two different set of jetty(10 & 12), but there were conflict errors. So for now I just upgraded s3Mock libs to also use Jetty12. Facing some issues with gcs-repository. Running successfully as Intellij test but failing If run via gradlew.
I did changed some code in SSLTestConfig
|
The discussion here relating to S3 dependencies reminds me of Lucene's PR apache/lucene#13949 (comment) with a comment yesterday on use of "aws-lightweight-client-java" |
e321ba0
to
31e58a1
Compare
Most of the test cases, I believe, are failing due to some issue with the Restore Command. Now in the logs, there is not much details regarding the issue and the only thing I got is.
But If I try to debug I can see more elaborated exception message which I believe for some reason was suppressed.
There is somewhat related issue opened on Jetty's github jetty/jetty.project#12518 |
Got some of the commits from the main branch. It would be great to remove those before someone would review this PR again. |
a30414d
to
dbe7c4f
Compare
The only failing test is the flaky one, I checked on develocity.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you read through Jetty's release notes to see if there's stuff we should do that would otherwise not be apparen't if we only fight imports & dependencies?
BTW I have yet to review the last 6 files but GitHub (or Intellij?) is struggling right now...
try { | ||
TraceUtils.setDbInstance(req, coreName); | ||
} catch (Exception e) { | ||
// TODO: Find better way to fix NPE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use "nocommit" which will also fail precommit until we get it fixed, serving as a reminder. Any way, this try-catch definitely shouldn't be here if it should be anywhere. We should fix what's null instead.
@@ -106,7 +106,7 @@ public static void setupCluster() throws Exception { | |||
((Metered) | |||
metricRegistry | |||
.getMetrics() | |||
.get("org.eclipse.jetty.servlet.ServletContextHandler.2xx-responses")) | |||
.get("org.eclipse.jetty.server.Handler$Wrapper.2xx-responses")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This metrics name seems poor. I wonder if it's due to us/Solr (thus we have easy control) or is this name chosen by Jetty / DropWizard.
@@ -93,40 +114,66 @@ private void assertCoreChosen(int numCores, TestRequest testRequest) throws Unav | |||
assertEquals(numCores, coreNames.size()); | |||
} | |||
|
|||
private static class TestResponse extends Response { | |||
public static class TestRequest implements HttpServletRequest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate mocks but as I look at this, mocking seems perfect so you don't have to implement everything. Or maybe there's a base class as there was before that you can extend. (Same feedback for another source file you did this in)
@@ -40,8 +49,9 @@ public void test() { | |||
"b", Set.of("1"), | |||
"c", Set.of("2")); | |||
|
|||
HttpServletRequest httpServletRequestMock = mock(HttpServletRequest.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha; you figured out mocking :-)
@@ -21,8 +21,8 @@ | |||
import static org.apache.solr.crossdc.common.KafkaCrossDcConf.ZK_CONNECT_STRING; | |||
|
|||
import com.codahale.metrics.SharedMetricRegistries; | |||
import com.codahale.metrics.servlets.MetricsServlet; | |||
import com.codahale.metrics.servlets.ThreadDumpServlet; | |||
import io.dropwizard.metrics.servlets.MetricsServlet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's suspicious to see we import com.codahale & io.dropwizard. Maybe okay but I wasn't expecting.
@@ -20,7 +20,9 @@ apply plugin: 'java-library' | |||
description = 'S3 Repository' | |||
|
|||
dependencies { | |||
api project(':solr:core') | |||
api(project(':solr:core')) { | |||
exclude group: 'org.ow2.asm', module: '*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
them solr:core shouldn't be publishing that dependency in the first place. At least see if that can be done.
@@ -214,14 +212,16 @@ | |||
<Set name="contexts"> | |||
<Ref refid="Contexts" /> | |||
</Set> | |||
<!-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appears to simply be some useless metadata we can remove
new DefaultSessionIdManager(server, new Random(random().nextLong()))); | ||
new WebAppContext(server, path, "/solr"); | ||
server.addBean(new DefaultSessionIdManager(server, new Random(random().nextLong()))); | ||
var webAppContext = new WebAppContext(path, "/solr"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: inline
@@ -65,16 +65,19 @@ dependencies { | |||
implementation libs.apache.log4j.api | |||
implementation libs.apache.log4j.core | |||
implementation libs.dropwizard.metrics.core | |||
implementation libs.dropwizard.metrics.jetty10 | |||
implementation (libs.dropwizard.metrics.jetty12.ee10){ | |||
exclude group: 'jakarta.servlet', module: 'jakarta.servlet-api' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as long as we explicitly depend on libs.jakarta.servlet.api
below (we do), I wonder do we really need to exclude it here?
chain = root; | ||
chain.setHandler(root); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's be clearer to do this at the front of this block.
https://issues.apache.org/jira/browse/SOLR-17069
Currently, Jetty supports several environments:
In my opinion, Jetty12 + EE8 is the best next step. It retains compatibility with javax.servlet without forcing the removal of modules that haven’t transitioned to jakarta.* yet, while benefiting from all the new features introduced in Jetty12.
#1509