-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
jetty-12 ee10 ServletRequestListeners called too many times on sendError #9637
Comments
Here's the relevant test failure output:
|
The fix for this will also most likely fix:
|
@lachlan-roberts I was going to raise a TCK challenge, but then I realised that there is an issue with the difference between dispatching to the ErrorHandler and to an error page used by the ErrorHandler. In the "error" test, sendError is called, we return from the servlet and then we need to generate an error page without a dispatch. We do this by dispatching to the ErrorHandler, so currently we are calling listeners when we shouldn't. But if the ErrorHandler has an error page, then it does an Dispatcher.error dispatch and at that point we should call the request listeners. So I do think we need to change a little bit, but not in the way we discussed before. |
…ener Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
…tListener Issue #9637 - Update behaviour and add testing for ServletRequestListener
We have fixed this in ee10 Jetty-12 with #9677, would be good to confirm that these TCK tests are now passing. |
…tListener Issue #9637 - Update behaviour and add testing for ServletRequestListener
Fixed |
jetty-12
Servlet tck error: https://jenkins.webtide.net/job/tck/job/tck-servlet-arquillian-experiment/job/jetty-12-ee10/119/testReport/junit/com.sun.ts.tests.servlet.spec.srlistener/URLClient/error/
The test sends a request to a servlet that does a
sendError(403)
, and then sends another request to check how many timesServletRequestListener.requestInitialized
andServletRequestListener.requestDestroyed
have been called. The test is expecting 3 calls: aninitialize
anddestroy
for the first request that sends the error, and then anotherinitialize
for the request that is checking the number of calls. The problem is that instead of 3 calls, we do 5: there is an extrainitialize
anddestroy
pair present before the lastinitialize
.The problem appears to be that
ServletChannel.dispatch
always callsServletContextHandler.requestInitialized
. This means that the firsthandle
loop will calldispatch
(which callsrequestInitialized
), but then the secondhandle
loop for theSEND_ERROR
case also callsdispatch
, leading to the second call toServletContextHandler.requestInitialized
.See line 656 of ServletChannel.dispatch.
Note: this may potentially affect ee9 too?
The text was updated successfully, but these errors were encountered: