Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49884
This required a major re-factoring of the async implementation. In summary:
- Moved state management to the Coyote Processor
- Added a SocketWrapper to the APR socket
- Added syncs to ensure only one async state change at a time
- Added syncs to ensure only one thread changing a socket's state at a time
A number of new bugs were also uncovered and fixed by this re-factoring:
- delay processing complete() and dispatch() until request where startAsync() is called finished processing
- onAsyncStart listener event
Currently the test case for bug 49884 passes with the security manager enabled using "ab -n 5000 -c 150 -k ..." (it broke with "ab -n 50 -c 10 ..." previously)
The unit tests pass for all three HTTP connectors.
The AJP connectors have only been modified to ensure the code compiles.
The following work remains:
- Testing all connectors (HTTP and AJP) with TCK + security manager and fixing whatever is broken
- Further clean-up
- There is further scope for reducing code duplication between the connectors / aligning the code so it is easier to maintain.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@
1001698 13f79535-47bb-0310-9956-
ffa450edef68