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

Support Jetty 11 #186

Merged
merged 18 commits into from
Nov 16, 2020
Merged

Support Jetty 11 #186

merged 18 commits into from
Nov 16, 2020

Conversation

f4lco
Copy link
Collaborator

@f4lco f4lco commented Nov 13, 2020

I made Jetty 11 work. It was really a lot of work and many test failures. I do not expect the changes to be overly controversial, but here are a few talking points:

  1. Is jakarta.* really a "system class"? This fixes a set of classloading issues in a logical way, but I wonder if they are indeed system classes, why isn't that enforced in Jetty by default? It also does not make sense to compile your app against one version of jakarta-servlet-api, and deploy to a server which ships with a different version. See 9d4bc4b.
  2. Jetty configuration files still have Jetty 10 in their DOCTYPE, not Jetty 11. Those files are not yet available - presumably they are once Jetty 11 is out of beta.
  3. The logging debacle. Currently, there is no way out of the slf4j alpha, the logback alpha, and the missing support for logging configuration via Groovy inside logback. If it never comes back (who knows?) that is a major breaking change, and all Groovy log configuration scripts would have to be replaced in integration tests, and we would have to find another way to programmatically configure logback. Right now a couple of Gretty's logging toggles are defunct.

f4lco added 18 commits November 13, 2020 10:53
The super-interface LifeCycleListener added default
methods. The adapter became redundant.
The Gradle module is called 'filterWebapp' on the filesystem.
Mind the lowercase 'a'! In Jetty 11, this caused Gretty to
fail to locate the filter configuration.
The FilteringClassLoader implements the server classes
concept, which Jetty appears to support natively.
I also cleaned up the list of server class patterns,
because I cannot figure out what exactly 'groovyjarjarantlr'
and the likes are supposed to match on.
Sharing the session handler between contexts leads to an NPE,
because startup of the first context now reaches into the
lifecycle of the second webapp, which has not started yet.
SessionHandler objects, which carry context-specific
lifecycle information, must not be shared between contexts.
@f4lco f4lco requested a review from boris-petrov November 13, 2020 15:07
@boris-petrov
Copy link
Member

@f4lco - thank you, yet again, for your hard work. I'm not sure how you can drink all the beer we owe you! 😄

You mention many test failures - you mean this was along the way, right? Because now I see that all tests are enabled and passing?

On your points:

  1. I'm not exactly sure I understand completely what that means but what you've written here and as a comment in the commit makes sense to me. This reminded me of an old commit I did a while ago - not sure if it is related in any way or if it can help you here.

  2. Yep, I also tried searching in their GitHub repo and there are no mentions of version 11 yet. We'll fix them when they appear.

  3. I opened an issue in their Jira. Let's see what they say.

Otherwise - amazing work as always! Thank you and feel free to merge when you want!

@boris-petrov
Copy link
Member

Oh, another thing I forgot. A lot of this code will be the same for Jetty 10, right? Perhaps it can be extracted in master and then when we rebase gretty4 on it we can just apply the few changes there? Do you think that makes sense and is it worth it?

@f4lco
Copy link
Collaborator Author

f4lco commented Nov 16, 2020

I'm not sure how you can drink all the beer we owe you!

Many thanks 😄

You mention many test failures - you mean this was along the way, right? Because now I see that all tests are enabled and passing?

Yes, that was along the way to this PR. Have a look at the commit history - almost every commit is inspired by some sort of test failure. Actually, I was pleasantly surprised how much signal I got out of the test suite. I supposed they either fail all together or none. In reality however, many test cases exercised the code in a unique way leading to unique root causes & distinct fixes.

Regarding the other points: that's basically what I was thinking - there's nothing to be done right now. I turned on notifications on the logback ticket you created, just in case. Thanks for that.

A lot of this code will be the same for Jetty 10, right?

Some sort of. I do know that a couple of patches apply to Jetty 10. However, they do not have a reasonable location on master. One would have to create the 'gretty-runner-jetty10' module in master first, and then possibly apply a subset of patches from this branch on top of it.

Perhaps it can be extracted in master and then when we rebase gretty4 on it we can just apply the few changes there?

This won't work for two reasons: first, as per comment above, the file directories are distinct, mostly it's not shared code between Jetty 10 and 11 that is affected. Second, I gave up 'rebase' strategy, and starting cherry-picking relevant commits from master a while ago. There have a been a couple of conflicts, changes which do not have an equivalent in grett4 because they affect older runners, and even changes which had already been done to gretty4. Time to remember those conflict resolutions & stabilize. When you cherry-pick and the build goes awry, it's easy to pinpoint and fix.

Thank you for your review!

@f4lco f4lco merged commit d356edb into gretty4 Nov 16, 2020
@f4lco f4lco deleted the feature/jetty11 branch November 16, 2020 09:04
@boris-petrov
Copy link
Member

@f4lco - I wasn't sure where to ping you so here is as good as it gets I guess.

I saw you working on a Jetty 10 branch a few days ago which later disappeared. What was up with that? I still have it locally if you've deleted it by accident. 😄

@f4lco
Copy link
Collaborator Author

f4lco commented Dec 7, 2020

@boris-petrov wow I guess my "work" does get noticed 😆

Yeah, eventually, I gave up on it, because I realized without shifting requirements in a major way, that patch isn't going to get merged. This is what the current compatibility looks like:

Java 8+ Java 11+
javax Gretty 3.x 🚫
jakarta 🚫 Gretty 4.x

... and Jetty 10 falls right in the upper corner, supporting javax, but having a minimum JDK requirement of 11.

So I am open to your suggestions to 'rescue' the patch, whether it's shifting requirements, or a technical solution. If you have a technical solution to the dilemma, I'd be glad to hear you out. I remember not reaching a definitive agreement on #161.
To be honest I wouldn't have started my work on Jetty 10 if I had recalled that situation correctly. My fingers were flying faster than I got to think this one through 😄

@boris-petrov
Copy link
Member

boris-petrov commented Dec 7, 2020

@f4lco - I was under the impression that Jetty 10 would be working on Java 8. If that's not so, I see no point in supporting it. The migration from Java 8 to Java 11 is a much bigger burden on people than renaming a bunch of imports from javax.* to jakarta.* so if they manage to do the former, they can definitely do the latter and just go to Jetty 11. Am I correct with these assumptions?

P.S. As for the branch - I restored the last version that I have. It's free to be there so let it stay for now. :) Thanks for the work!

@f4lco
Copy link
Collaborator Author

f4lco commented Dec 7, 2020

Yes, I think you are correct, and we are on the same page here 👍
Since the branch is up again, one can view the build history on Travis, too. Sadly the picture is quite clear: JDK 8 builds are the only ones to fail, and the reason is a compilation failure right in the Jetty 10 module: https://travis-ci.org/github/gretty-gradle-plugin/gretty/builds/747443668
You're welcome and thanks for reaching out!

@f4lco f4lco mentioned this pull request Dec 9, 2020
@boris-petrov boris-petrov mentioned this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants