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 2012/04/11 09:30:35 UTC
DO NOT REPLY [Bug 53061] New: tomcat asynchronous invocation problem
https://issues.apache.org/bugzilla/show_bug.cgi?id=53061
Bug #: 53061
Summary: tomcat asynchronous invocation problem
Product: Tomcat 7
Version: 7.0.25
Platform: Other
OS/Version: Linux
Status: NEW
Severity: major
Priority: P2
Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: vyacheslav.trainin@playtech.com
Classification: Unclassified
Created attachment 28581
--> https://issues.apache.org/bugzilla/attachment.cgi?id=28581
a simple test reproducing the problem
We encountered a problem during asynchronous operations (tomcat7 with servlet
3).
Description:
One client continuously sends post requests to the server. On the server side
for each request created AsyncContext with timeout 20 seconds:
AsyncContext asyncContext = req.startAsync(req, resp);
asyncContext.setTimeout(20000);
As expected after approximately 20 sec the requests are completed. Then another
client also begins to send requests to the server but in this case they are
explicitly completed after 500 milliseconds. Something like this:
AsyncContext asyncContext = req.startAsync(req, resp);
asyncContext.setTimeout(20000);
try {
Thread.sleep(500);
} catch (Exception e) {
}
asyncContext.complete();
The problem is that after running the second client all requests that are
waiting for timeout (from the first client) are stuck and not released
(onTimeout method of AsyncEvent is not called) until the second client stops
sending requests.
It looks like the problem occurs on Linux but not on Windows.
I attached a simple test that may help to reproduce this issue. The following
servlet accepts URL parameter “complete”.
When “complete=1” the request will be completed after 500ms.
Otherwise the request will wait till timeout (20 seconds).
Run client that periodically sends requests to /servlet?complete=0. (I have
tested it with 10 parallel threads that run in a loop)
Then run another client that periodically sends requests to /servlet?complete=1
(This client can use only a single thread)
See that the first client does not receive any responses while the second
client is running.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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
DO NOT REPLY [Bug 53061] tomcat asynchronous invocation problem
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53061
Slava <vy...@playtech.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vyacheslav.trainin@playtech
| |.com
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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
DO NOT REPLY [Bug 53061] tomcat asynchronous invocation problem
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53061
--- Comment #1 from Slava <vy...@playtech.com> 2012-04-11 07:46:56 UTC ---
Reproduced on:
- tomcat-7.0.23, 7.0.25 and 7.0.26
- java 64 bit 1.6.0_18 and 1.6.0_29
- Linux CentOS release 5.6 (Final) 64 bit
- NIO connector
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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 53061] tomcat asynchronous invocation problem
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53061
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Mark Thomas <ma...@apache.org> ---
For once, it wasn't an issue triggered by the refactoring. It looks like a long
standing issue that just hasn't been noticed before now.
This has been fixed in trunk and 7.0.x and will be included in 7.0.28 onwards.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53061] tomcat asynchronous invocation problem
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53061
--- Comment #5 from Mark Thomas <ma...@apache.org> ---
Thanks for that. I can now re-produce it. I can also reproduce it on Windows.
The key to reproducing it is to refresh the browser more frequently then once a
second - the faster the refresh the clearer the reproduction.
Looking at the NIO source code, there is a test that essentially means that
timeouts only get processed after one second of inactivity so under high,
constant load, timeouts will never be processed.
I find it hard to believe it has always been like that so I'll need to go back
and research who changed it (probably me), when it changed (probably the
refactoring) and why it changed (probably an error on my part). I should be
able to get that done pretty quickly.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53061] tomcat asynchronous invocation problem
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53061
--- Comment #3 from Slava <vy...@playtech.com> ---
Created attachment 28754
--> https://issues.apache.org/bugzilla/attachment.cgi?id=28754&action=edit
war
Added war to the provided souorce
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53061] tomcat asynchronous invocation problem
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53061
Slava <vy...@playtech.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|WORKSFORME |---
--- Comment #4 from Slava <vy...@playtech.com> ---
We still have this problem and it is a critical for our project. I attached a
war file and reopened the issue.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53061] tomcat asynchronous invocation problem
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53061
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |WORKSFORME
--- Comment #2 from Mark Thomas <ma...@apache.org> ---
I extracted the key elements from this test case into my own test web
application as thay as quicker than downloading Maven, installing it and
figuring out how to use it.
The test worked for me on both Linux and Windows using the NIO connector.
If you still see this problem, feel free to re-open this issue but you will
need to provide a ready-to-run WAR that demonstrates the issue along with the
source for that WAR.
--
You are receiving this mail because:
You are the assignee for the bug.