-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Upgrade to Jetty 9.4.21.v20190926 #18494
Comments
9.4.21 appears to contain some changes in behaviour that cause some test failures:
Further investigation is needed to see if we can work around things in Boot or if there's a regression in Jetty that will need to be fixed there. |
If it helps: I think the changes that make the errorPage tests fail are likely located in this commit: jetty/jetty.project@bde8646. I didn't get to the exact root cause yet, but Boot's I didn't get to the session tests yet, but unlike before a new session seems to be created every time which breaks the logic in AbstractServletWebServerFactoryTests.java#L1124 as it can't find the session attribute anymore. I haven't found the commit yet that causes it, but there were definitely changes in the session handling (e.g. jetty/jetty.project#4049) I initially hoped to fix the issue, but wanted to at least share the findings. |
Thanks very much for sharing your analysis, @dreis2211. |
So here's a follow-up on the issues: Error pagesWith the following minimal patch I get the error page related tests to run again (a more complete version would get rid of the custom --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedErrorHandler.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedErrorHandler.java
@@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.ErrorHandler;
+import org.eclipse.jetty.server.handler.ErrorHandler.ErrorPageMapper;
/**
* Variation of Jetty's {@link ErrorHandler} that supports all {@link HttpMethod
@@ -36,7 +37,7 @@ import org.eclipse.jetty.server.handler.ErrorHandler;
*
* @author Phillip Webb
*/
-class JettyEmbeddedErrorHandler extends ErrorHandler {
+class JettyEmbeddedErrorHandler extends ErrorHandler implements ErrorPageMapper {
private final ErrorHandler delegate;
@@ -54,6 +55,19 @@ class JettyEmbeddedErrorHandler extends ErrorHandler {
this.delegate.handle(target, baseRequest, request, response);
}
+ @Override
+ public boolean errorPageForMethod(String method) {
+ return true;
+ }
+
+ @Override
+ public String getErrorPage(HttpServletRequest request) {
+ if (this.delegate instanceof ErrorPageMapper) {
+ return ((ErrorPageMapper) this.delegate).getErrorPage(request);
+ }
+ return null;
+ }
+
private static class ErrorHttpServletRequest extends HttpServletRequestWrapper {
private boolean simulateGetMethod = true; SessionsThat leaves us with
I'm out of ideas (and time to generate new ideas ;-) ) at the moment, but I hope this helps with finding the root cause. Is there value in reporting this already to the Jetty team? |
For the error page stuff there is an issue already that might be of interest: jetty/jetty.project#4154 |
Thanks again, @dreis2211. The session problem may well be worth reporting. Let me see if I can find some time to dig into it a bit so that we have something concrete to report. Next week's SpringOne Platform is looming large at the moment so it may take a little while. |
Have fun at SpringOne Platform then. At some point I hope we can meet up at one of those conferences and have a chat in person. |
There was a bug opened at Jetty that seemed interesting enough as it's also a regression in the session handling. Unfortunately, when building the branch and testing the proposed fix this doesn't have an impact on the |
I could finally reproduce the behavior change (which appears to be connected to using a cookie with a JSESSIONID). I reported this already to Jetty and hope that's okay. Let's see what comes out of it. If it turns out not to be a bug, I have at least found a fix for the tests. |
Thanks again, @dreis2211. Judging by the Jetty team's response, it looks reasonable to me to just update our tests not to set the |
Already tried it before reporting this to Jetty and it's indeed not needed (hence my comment that I at least found a fix already). ;-) There's still a request for feedback if that change was intentional, so I'd suggest to wait a bit still before finishing this up. But I can already provide a PR with the necessary changes, if you want me to. |
As the change in the error page handling is likely not working for versions <= 9.4.20 (because of the unknown |
I opened #18536, so it's easier to talk about potential code changes. |
Closing in favor of PR #18536 |
No description provided.
The text was updated successfully, but these errors were encountered: