Skip to content

Conversation

@cgivre
Copy link
Contributor

@cgivre cgivre commented Nov 10, 2025

DRILL-8540: Update Jetty to Version 12

Description

This PR completes the Jetty 12 upgrade by updating drill-yarn's WebServer to use Jakarta EE 10 APIs and the new Jetty 12 servlet packages. Key changes include:

  • Migrating to org.eclipse.jetty.ee10.servlet imports,
  • Updating LoginService.login() method signatures, adopting the new ResourceFactory API, and
  • Fixing ServletContextHandler constructor usage.
  • Four MiniDFSCluster-dependent impersonation tests have been marked with @Ignore annotations due to an unresolvable conflict between Drill's Jetty 12 and Hadoop 3.x's Jetty 9 dependencies. These tests can be re-enabled when Hadoop upgrades to Jetty 12 (tracked in HADOOP-19625).
  • Fix a possible minor resource leak in Splunk plugin.

Comprehensive documentation has been added in docs/dev/Jetty12Migration.md explaining the changes, known limitations, and developer guidelines for working with Jetty 12.

End of Java 11 Support

As Jetty 12 does not support Java < 17, this PR effectively terminates Drill's support for Java 11. Github actions have been adjusted accordingly. Note that Calcite is also migrating to Jetty 12, so if we wish to keep Drill in sync with Calcite, this is a necessary step.

Note on Splunk Tests

For some reason, the Jetty upgrade caused issues with the Splunk testing infrastructure. It is not clear why, but this has been resolved in this PR.

Documentation

No user facing changes.

Testing

Ran existing unit tests and tested WebUI manually.

@cgivre cgivre self-assigned this Nov 10, 2025
@cgivre cgivre added dependencies backport-to-stable This bug fix is applicable to the latest stable release and should be considered for inclusion there stability labels Nov 10, 2025
@cgivre cgivre linked an issue Nov 10, 2025 that may be closed by this pull request
Copy link

@joakime joakime left a comment

Choose a reason for hiding this comment

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

Overall a great changeset.
Just a few suggestions.

<jersey.version>2.40</jersey.version>
<jetty.version>9.4.56.v20240826</jetty.version>
<jersey.version>3.1.9</jersey.version>
<jetty.version>12.0.15</jetty.version>
Copy link

Choose a reason for hiding this comment

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

btw, Jetty has BOM dependencies that can be used as well.
One for core, and one for the environment you choose to use.
Would you be interested in that?

verify(response, never()).sendError(401);
verify(response, never()).setHeader(HttpHeader.WWW_AUTHENTICATE.asString(), HttpHeader.NEGOTIATE.asString());
// This test needs to be rewritten for Jetty 12 API
// TODO: Rewrite for Jetty 12
Copy link

Choose a reason for hiding this comment

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

It's often easier, and faster to execute, using a real server instance + using an HTTP client to connect to it.

verify(response, never()).sendError(401);
verify(response, never()).setHeader(HttpHeader.WWW_AUTHENTICATE.asString(), HttpHeader.NEGOTIATE.asString());
// This test needs to be rewritten for Jetty 12 API
// TODO: Rewrite for Jetty 12
Copy link

Choose a reason for hiding this comment

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

Directly mocking the HttpServletRequest isn't a great choice for testing.
It doesn't test the actual implementation, which depends heavily on internal HttpServletRequest instance types.
Using a real server, and real HTTP requests, is often faster to setup, and test.

@cgivre
Copy link
Contributor Author

cgivre commented Nov 19, 2025

@joakime Thanks for the review. I believe I addressed all your comments.

@cgivre
Copy link
Contributor Author

cgivre commented Nov 20, 2025

@joakime Thanks for your review. All unit tests are now passing again, and I believe it is ready for another look.

@cgivre
Copy link
Contributor Author

cgivre commented Nov 30, 2025

@joakime I hope all is well. Do you think you'll have some time to do another review? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-stable This bug fix is applicable to the latest stable release and should be considered for inclusion there dependencies stability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to Jetty v12

2 participants