Skip to content
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

Bump Spring and Jetty dependencies #5372

Merged
merged 21 commits into from
Jan 25, 2024
Merged

Bump Spring and Jetty dependencies #5372

merged 21 commits into from
Jan 25, 2024

Conversation

ikhoon
Copy link
Contributor

@ikhoon ikhoon commented Jan 8, 2024

Motivation:

Spring 6 HTTP client is split into two parts.
#4838 (comment) It will be easier to review if Spring dependencies are upgraded before working on Spring HTTP 6 integration.

Dependencies:

  • Spring 6.0.13 -> 6.1.2
  • Spring Boot 2.7.16 -> 2.7.18, 3.1.4 -> 3.2.1
  • Jetty 12.0.5

Modifications:

  • Spring Boot Actuator
    • @AutoConfigureMetrics has been removed in favor of @AutoConfigureObservability. Disable tracing in integration tests spring-projects/spring-boot#31308
    • @EnableTestMetrics is added in Spring Boot 2 and 3 modules to share the same test code.
      • @EnableTestMetrics in boot2-actuator-autoconfigure inherits @AutoConfigureMetrics but @AutoConfigureObservability is inherited in boot3-actuator-autoconfigure.
  • Spring Boot WebFlux
  • Jetty 12
    • Jetty version has been upgraded to 12 in Spring Boot 3.2. Upgrade to Jetty 12 spring-projects/spring-boot#36073
    • Jetty core module is now independent of Servlet API. https://webtide.com/introducing-jetty-12/
      • Due to the change, the existing JettyService code can no longer be reused, so JettyService is newly implemented based on the Jetty 12 API.
    • JettyServiceBuilder
      • JettyServiceBuilder.tlsReverseDnsLookup() is removed because Jetty ServletApiRequest.getRemoteHost() does not perform a reverse DNS lookup.
      • JettyServiceBuilder.handlerWrapper(HandlerWrapper) has been removed in favor of JettyServiceBuilder.insertHandler(Handler.Singleton)
        • HandlerWrapper does not exist in Jetty 12.
        • insertHandler(Handler.Singleton) is the most similar replacement.
      • JettyServiceBuilder.sessionIdManager(SessionIdManager) and sessionIdManagerFactory(Function) have been removed because Server.setSessionIdManager() does not exist.
    • JettyService
      • Jetty Request becomes immutable so Armeria request headers are indirectly set via HttpChannel.onRequest()
      • HttpStreamOverHTTP1 provides a request body instead of HttpChannelOverHttp.
      • A response is now written to HttpStreamOverHTTP1.send(...). Previously, HttpConnection.send(...) was used.
      • Failed to find the counterpart of jReq.setDispatcherType() and jReq.setAsyncSupported().
        • Without setAsyncSupported, async could support via Callback interface.
      • httpChannel.handle() has been replaced with httpChannel.onRequest(requestMetadata).run().

Motivation:

Spring 6 HTTP client is split into two parts.
line#4838 (comment)
It will be easier to review if Spring dependencies is upgraded
before working on Spring HTTP 6 integration.

- Spring 6.0.13 -> 6.1.12
- Spring Boot 2.7.16 -> 2.7.18, 3.1.4 -> 3.2.1
@ikhoon ikhoon added this to the 1.27.0 milestone Jan 8, 2024
Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (30c9718) 0.00% compared to head (b567dbf) 73.77%.
Report is 27 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5372       +/-   ##
===========================================
+ Coverage        0   73.77%   +73.77%     
- Complexity      0    20460    +20460     
===========================================
  Files           0     1776     +1776     
  Lines           0    75521    +75521     
  Branches        0     9628     +9628     
===========================================
+ Hits            0    55719    +55719     
- Misses          0    15181    +15181     
- Partials        0     4621     +4621     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ikhoon ikhoon changed the title Bump Spring dependencies Bump Spring and Jetty dependencies Jan 15, 2024
.getBytes(StandardCharsets.US_ASCII);

@Override
public boolean handle(Request req, Response res, Callback callback) throws Exception {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic is similar to AsyncStreamingHandlerFunction in Jetty 11 module but the super interface has been changed.

@ikhoon ikhoon marked this pull request as ready for review January 15, 2024 15:51
@ikhoon
Copy link
Contributor Author

ikhoon commented Jan 15, 2024

Sorry for the massive change in a single PR. 😅
Jetty 12 module was added in this PR to test compatibility with Spring Boot 3.2.

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! Left some minor comments 🙇

/**
* A skeletal builder implementation for {@link JettyServiceBuilder} in Jetty 9 and Jetty 10+ modules.
*/
public abstract class AbstractJettyServiceBuilder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question) What do you think of moving the deprecated methods to jetty11/JettyServiceBuilder and sharing the implementation of AbstractJettyServiceBuilder between jetty11 and jetty12?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JettyServiceBuilder exists in both jetty11 and jetty9. Let me move the deprecated methods to them.

Copy link
Contributor

@minwoox minwoox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me. Thanks a lot! 🙇

Copy link
Contributor

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update micrometer deps as the latest patch of spring boot causes a conflict with what we have.

-micrometer = "1.11.5"
-micrometer-tracing = "1.1.6"
-micrometer-docs-generator = "1.0.2"
+micrometer = "1.12.2"
+micrometer-tracing = "1.2.2"
+micrometer-docs-generator = "1.0.3"

Noticed this in zipkin until I bumped micrometer, too

 java.lang.NoSuchMethodError: 'void io.micrometer.core.instrument.binder.jvm.ExecutorServiceMetrics.<init>(java.util.concurrent.ExecutorService, java.lang.String, java.lang.String, java.lang.Iterable)'
	at com.linecorp.armeria.server.DefaultServerConfig.monitorBlockingTaskExecutor(DefaultServerConfig.java:331)

dependencies.toml Outdated Show resolved Hide resolved
dependencies.toml Outdated Show resolved Hide resolved
@cj848
Copy link

cj848 commented Jan 24, 2024

I'm just waiting for this PR to be merged.

@ikhoon
Copy link
Contributor Author

ikhoon commented Jan 24, 2024

Can you also update micrometer deps as the latest patch of spring boot causes a conflict with what we have.

Sure, I will bump all other dependencies in a dependency upgrade PR.

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks @ikhoon 🙇 👍 🙇 (bar the lint failures)

@ikhoon
Copy link
Contributor Author

ikhoon commented Jan 25, 2024

The lint failure is fixed in the main branch with e3ba6ec

@ikhoon ikhoon merged commit 16455d9 into line:main Jan 25, 2024
15 of 16 checks passed
@ikhoon ikhoon deleted the up-spring-deps branch January 25, 2024 04:58
@codefromthecrypt
Copy link
Contributor

woot 🥇

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.

5 participants