Summary: | Exception when writing HTTP response in the AsyncListener onTimeout method (servlet 3 HTTP-NIO) | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Dario Franceschi <dario.franceschi> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | regression | ||
Priority: | P2 | ||
Version: | trunk | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: |
Servlet
Context listener bug32051.war |
Created attachment 32051 [details]
Context listener
If you omit the close on the printwriter the socket will be RST before the data is transferred causing for instance wget to re-submit
Seems I only get this on windows 7 (64) and tomcat 8 ( tried 8-11 & 8-12 ) on tomcat 7 I do not get this, I do not get this on tomcat 8 on (32 bit) linux either. Have also tried Java7 & Java8 but that does not seem to be related. Created attachment 32052 [details] bug32051.war A war file that contains reproducer classes, as submitted by Dario Franceschi, compiled with Java 6. Steps to reproduce: 1. Deploy the war 2. Access http://localhost:8080/bug32051 A simple HTML page with word "hej" is displayed in browser. 3. The INFO message from CoyoteAdapter.checkRecycled is printed on the console It reproduces for me with current Tomcat 8 (trunk @r1627265) with every one of 4 connectors (Bio, Nio, Nio2, Apr) using JDK 7u67 (32-bit) on Windows 7. It does not reproduce for me with current Tomcat 7 (tc7.0.x @r1627245) with any of 3 connectors (Bio, Nio, Apr) and any of {JDK 6u45, 7u67} (32-bit) on Windows 7. The page is displayed and there is no log message. Comment on attachment 32051 [details]
Context listener
Thanks for the WAR Konstantin. I see this on OSX. It looks to be OS neutral to me.
I'll note that the AsyncListener should be calling AsyncContext.complete() at the end of onTimeout() which may avoid this error. Irrespective of that, this is still a bug that needs to be fixed.
This has been fixed in 8.0.x and will be included in 8.0.13 onwards. This has been back-ported in 7.0.x and will be included in 7.0.56 onwards. i use the tomcat7.0.61,and got the exception: Nov 18, 2015 10:01:43 AM org.apache.catalina.connector.CoyoteAdapter checkRecycled INFO: Encountered a non-recycled response and recycled it forcedly. org.apache.catalina.connector.CoyoteAdapter$RecycleRequiredException at org.apache.catalina.connector.CoyoteAdapter.checkRecycled(CoyoteAdapter.java:592) at org.apache.coyote.http11.AbstractHttp11Processor.recycle(AbstractHttp11Processor.java:1814) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.release(Http11NioProtocol.java:218) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:703) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1700) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) i don't know how to fix it,it looks like this bug I upgrade to tomcat8.0.28,hope that it will be ok |
Created attachment 32050 [details] Servlet Get the following exception every time the onTimeout method has been called INFO: Encountered a non-recycled request and recycled it forcedly. org.apache.catalina.connector.CoyoteAdapter$RecycleRequiredException at org.apache.catalina.connector.CoyoteAdapter.checkRecycled(CoyoteAdapter.java:717) at org.apache.coyote.http11.AbstractHttp11Processor.recycle(AbstractHttp11Processor.java:1791) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.release(Http11NioProtocol.java:239) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:733) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:724)