-
Notifications
You must be signed in to change notification settings - Fork 50
Upgrade to Jetty 12 #99
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
Conversation
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.
For first half of PR. Will add more later when I get the chance
concurrent/src/main/java/com/facebook/airlift/concurrent/AsyncSemaphore.java
Show resolved
Hide resolved
dbpool/src/main/java/com/facebook/airlift/dbpool/H2EmbeddedDataSource.java
Show resolved
Hide resolved
event/src/main/java/com/facebook/airlift/event/client/JsonEventWriter.java
Show resolved
Hide resolved
52acde5
to
a53e209
Compare
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.
Hi @ZacBlanco , everything looks good !
Upgrading Jetty seems to be a cleaner way to upgrade. You have responded to the suggestions from modernizer plugin.
a53e209
to
fa7934d
Compare
I have a PR open to test the CI on this for now until we have a new release of airbase: #100 |
fa7934d
to
02bb691
Compare
This PR is ready to be reviewed. The only required remaining change is to use the new airbase version in the root pom. Everything else should be set. I am happy to re-arrange/squash commits as reviewers see fit, but I would like to wait until review is finished to squash/split any commits |
ae7e9e7
to
844de99
Compare
airbase 105 is now released- the CI should run successfully on this PR now |
Hopefully this is helpful. |
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.
Short first pass
http-client/src/main/java/com/facebook/airlift/http/client/jetty/JettyHttpClient.java
Show resolved
Hide resolved
http-client/src/main/java/com/facebook/airlift/http/client/jetty/JettyHttpClient.java
Show resolved
Hide resolved
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.
Flush 1
http-client/src/main/java/com/facebook/airlift/http/client/jetty/JettyHttpClient.java
Show resolved
Hide resolved
http-client/src/main/java/com/facebook/airlift/http/client/jetty/JettyHttpClient.java
Show resolved
Hide resolved
http-server/src/main/java/com/facebook/airlift/http/server/HttpServer.java
Outdated
Show resolved
Hide resolved
http-server/src/main/java/com/facebook/airlift/http/server/HttpServer.java
Outdated
Show resolved
Hide resolved
http-server/src/main/java/com/facebook/airlift/http/server/HttpServer.java
Show resolved
Hide resolved
http-client/src/main/java/com/facebook/airlift/http/client/jetty/JettyHttpClient.java
Show resolved
Hide resolved
http-server/src/main/java/com/facebook/airlift/http/server/HttpServerChannelListener.java
Show resolved
Hide resolved
@ethanyzhang imported this issue into IBM GitHub Enterprise |
...lient/src/main/java/com/facebook/airlift/http/client/jetty/BodyGeneratorContentProvider.java
Outdated
Show resolved
Hide resolved
http-server/src/main/java/com/facebook/airlift/http/server/ClassPathResourceHandler.java
Outdated
Show resolved
Hide resolved
e19d744
to
9545845
Compare
general question: does this mean that airlift will no longer work with java 8? How will that fit with keeping some parts of presto at language level 8? |
Some modules are kept at language level 8, some will move to 17. It is controlled by the property: These are the modules in airlift whose minimum bytecode compatibility is being moved to 17 (due to dependencies on jetty 12 or on another module which depends on http-client/server).
You can search for As for Presto, I have a draft PR up which is passing most unit tests, including most PoS ones where the PoS JDK level is still set to 8. See prestodb/presto#24869 |
68e171c
to
5e1a475
Compare
5e1a475
to
34dff03
Compare
This commit upgrades the codebase to use jetty 12 along with all the dependent modules. There are a large number of changes outside of jetty that are required to comply with the updated APIs as well as some of the newer modernizer rules that execute with the target bytecode of some modules set to 17 The main types of changes are outlined below: 1. Nearly all usage of packages from javax.annotation, javax.validation javax.inject, javax.ws.rs-api, and javax.servlet have been replaced with the newer jakarta.* APIs. This is a requirement due to the newer jetty version requiring these libraries in order properly function. Some annotations have been removed entirely from the jakarta.annotation package, so they have been replaced with equivalent annotations from com.google.errorprone:error_prone_annotations package. Guice was upgraded to 7.0 to support the jakarta.inject namespace 2. Minimum bytecode level on some modules being raised to 17. Due to Jetty 12 being compiled for Java 17 bytecode, it means modules which rely on jetty directly and transitively must be compiled with java 17 bytecode as well. http-client and http-server are the modules with direct dependencies on jetty, but many other such as event, discovery, and more have their bytecode level increased in order to accomodate the jetty upgrade. Bytecode levels are set in the project's pom.xml <properties> tag using <project.build.targetJdk> 3. Modernizer changes. Due to modules being upgraded to Java 17 bytecode some new modernizer rules are now enforced to take advantage of the new Java 17 APIs. Many modules have slight changes to comply with our modernizer plugin. Most changes center around using Path instead of File and Java Streams API equivalents in place of Guava Iterables and Functions 4. The configuration's validator implementation is updated to use the hibernate validator instead of Apache bval-jsr. This is because the bval-jsr dependency does not support the jakarta namespace annotations at a java 8 bytecode level. Hibernate is used because it satisfies the requirement to keep this module at Java 8 bytecode. Aside from these, the rest of the changes center around supporting Jetty 12's new APIs within our http-client and http-server implementation. For example, supporting the new ContentProvider APIs and changing usages of deprecated or removed methods from Jetty 9.
34dff03
to
7650fcc
Compare
The default previously was quiet period of 2 seconds and a timeout of 15 seconds. This cuts drift-integration-tests runtime from 7 minutes to about 10-20 seconds
connectionPoolMaintenanceExecutor.shutdownNow(); | ||
try { | ||
group.shutdownGracefully().await(); | ||
group.shutdownGracefully(0, 1, SECONDS).await(); |
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.
Instead of changing the default, should we instead make it configurable so tests can shutdown quickly ?
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.
Making it configurable is a good idea. We can probably just add some parameters like quietPeriodSeconds and shutdownTimeoutSeconds
This PR moves airlift from Jetty 9.X to Jetty 12, the latest stable Jetty release. It provides a wide range of improvements
javax.*
APIs tojakarta.*
It also however requires significant refactoring of not just the Jetty libraries, but also moving things like
javax
servlets to thejakarta
namespace as well as bumping the minimum bytecode version on components which rely on jetty to Java 17.