You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/12/29 20:40:03 UTC
[Bug 55939] New: Seeing issues with non-blocking io when writing
lots of data
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: dmikusa@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 55939] Seeing issues with non-blocking io when writing lots of
data
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55939
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
OS| |All
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Thanks for the test case. I've figured out what was going wrong and fixed it in
trunk.
The test case is such that occasionally a request will fail. This happens when
- for some reason (e.g. a GC pause) - the client stops reading for more than to
100ms timeout or doesn't start reading the response for more than 100ms.
Because the test case does regularly fail, I have not added it to the unit
tests (now the issue is understood it should be possible to write a test case
that checks this problem and always passes if and only if the problem is
fixed).
The problem was that some of the flags used to handle non-blocking IO were not
reset between requests. Once a request failed, all subsequent requests that
used the same response object would also fail because the flags were set to
indicate that the socket was registered for write with the Poller when that was
not the case.
This has been fixed in r1554298.
With the fix in place I still see occasional failures but I only see single
failures rather than all subsequent requests failing.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org