https://issues.apache.org/bugzilla/show_bug.cgi?id=55939

            Bug ID: 55939
           Summary: Seeing issues with non-blocking io when writing lots
                    of data
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: dmik...@gopivotal.com

Created attachment 31164
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31164&action=edit
Unit test to replicate the problem

I have a simple servlet which I'm running on Tomcat 8 trunk (1554057) with Java
7.  It's using a non-blocking IO WriteListener to write 8k blocks of static
data to the response.  The number of blocks it will write is given as a request
parameter.

When I start out making individual requests to the server (1-1000 blocks)
things are fine and those are handled without a problem.  However once I start
to send multiple requests using JMeter, requests begin to fail.  It starts
slowly with
only a few requests failing and then proceeds to the point where every request
fails.  

At that point, Tomcat will serve JSP pages and Servlets that use blocking IO,
but it will not serve any requests that use the non-blocking IO apis
(ReadListener / WriteListener).  For example, if I try to hit the byte counter
servlet or number writer servlet included in the examples then my browser will
timeout or display the error "java.lang.IllegalStateException:
getOutputStream() has already been called for this response".

I put together a unit test that replicates the async context timeout issue. 
Code is attached.  When run, you'll see that it processes some of the requests
but fails due to a timeout.  Note 1 out of 5 times on my laptop the attached
test will pass, so you may need to run it a couple times to see the issue.

More details on this email thread: 
http://tomcat.markmail.org/message/jcgwqb7i5dgqtcqz

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to