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

Reset trailers on recycled response #4711

Closed
gregw opened this issue Mar 25, 2020 · 5 comments
Closed

Reset trailers on recycled response #4711

gregw opened this issue Mar 25, 2020 · 5 comments
Assignees
Labels
Specification For all industry Specifications (IETF / Servlet / etc) TCK For various Specification Test Compatibility Kits (eg: Servlet, WebSocket, HTTP/2, etc)

Comments

@gregw gregw added Specification For all industry Specifications (IETF / Servlet / etc) TCK For various Specification Test Compatibility Kits (eg: Servlet, WebSocket, HTTP/2, etc) labels Mar 25, 2020
@gregw gregw self-assigned this Mar 25, 2020
@gregw
Copy link
Contributor Author

gregw commented Mar 25, 2020

[javatest.batch] <title>Error 500 java.lang.NullPointerException</title>
[javatest.batch] </head>
[javatest.batch] <body><h2>HTTP ERROR 500 java.lang.NullPointerException</h2>
[javatest.batch] <table>
[javatest.batch] <tr><th>URI:</th><td>/servlet_jsh_httpservletresponse40_web/TrailerTestServlet</td></tr>
[javatest.batch] <tr><th>STATUS:</th><td>500</td></tr>
[javatest.batch] <tr><th>MESSAGE:</th><td>java.lang.NullPointerException</td></tr>
[javatest.batch] <tr><th>SERVLET:</th><td>TrailerTestServlet</td></tr>
[javatest.batch] <tr><th>CAUSED BY:</th><td>java.lang.NullPointerException</td></tr>
[javatest.batch] </table>
[javatest.batch] <h3>Caused by:</h3><pre>java.lang.NullPointerException
[javatest.batch] 	at com.sun.ts.tests.servlet.api.javax_servlet_http.httpservletresponse40.TrailerTestServlet.doPost(TrailerTestServlet.java:44)
[javatest.batch] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:523)
[javatest.batch] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
[javatest.batch] 	at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1338)
[javatest.batch] 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:716)
[javatest.batch] 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:538)
[javatest.batch] 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
[javatest.batch] 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:561)
[javatest.batch] 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
[javatest.batch] 	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:228)
[javatest.batch] 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1575)
[javatest.batch] 	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:226)
[javatest.batch] 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1237)
[javatest.batch] 	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:181)
[javatest.batch] 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:475)
[javatest.batch] 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1548)
[javatest.batch] 	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:179)
[javatest.batch] 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1156)
[javatest.batch] 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:134)
[javatest.batch] 	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:218)
[javatest.batch] 	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
[javatest.batch] 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
[javatest.batch] 	at org.eclipse.jetty.server.Server.handle(Server.java:545)
[javatest.batch] 	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:375)
[javatest.batch] 	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:559)
[javatest.batch] 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:367)
[javatest.batch] 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:290)
[javatest.batch] 	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:321)
[javatest.batch] 	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
[javatest.batch] 	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
[javatest.batch] 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
[javatest.batch] 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
[javatest.batch] 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
[javatest.batch] 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
[javatest.batch] 	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
[javatest.batch] 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:823)
[javatest.batch] 	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:945)
[javatest.batch] 	at java.base/java.lang.Thread.run(Thread.java:834)
[javatest.batch] </pre>

@gregw
Copy link
Contributor Author

gregw commented Mar 25, 2020

I've also noted that sending and error has not reset either the transfer-encoding nor the trailers themselves!

gregw added a commit that referenced this issue Mar 25, 2020
Whilst investigating #4711 for jetty-10, it was noticed that trailers are not nulled on recycled Response instances, nor on reset.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
sbordet added a commit that referenced this issue Mar 25, 2020
Test code cleanup.
Added test for Response.reset().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet
Copy link
Contributor

sbordet commented Mar 25, 2020

@gregw trailers done, but Transfer-Encoding (or anything else) not done, so I'm leaving this issue open.

gregw added a commit that referenced this issue Apr 1, 2020
Standard trailers cannot be set if committed or HTTP/1.0

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@joakime joakime changed the title Jetty-10 TCK Trailer tests failing Reset trailers on recycled response Apr 8, 2020
gregw added a commit that referenced this issue Nov 11, 2020
Reordered recycle in request and response to field order so that we can check that all fields are recycled.
@gregw
Copy link
Contributor Author

gregw commented Nov 12, 2020

@sbordet See #5643... is that sufficient to close this issue?

gregw added a commit that referenced this issue Nov 16, 2020
* Cleanup request/response recycle #4711

Reordered recycle in request and response to field order so that we can check that all fields are recycled.

* Fixed ordering of reader consumption

* update from review
@gregw
Copy link
Contributor Author

gregw commented Jul 12, 2024

passing asssociated TCK test so closing this one

@gregw gregw closed this as completed Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Specification For all industry Specifications (IETF / Servlet / etc) TCK For various Specification Test Compatibility Kits (eg: Servlet, WebSocket, HTTP/2, etc)
Projects
None yet
Development

No branches or pull requests

2 participants