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

--- Comment #2 from heyoulin <heyou...@hotmail.com> 2010-08-04 12:02:52 EDT ---
(In reply to comment #1)
> Which version are you using?
> There were a number of fixes in this area included in 7.0.2 (currently being
> voted on for release).
> Whilst the release vote is in progress, you can get a copy for testing from
> here:
> http://people.apache.org/~markt/dev/tomcat-7/v7.0.2/
> Note that this is NOT an official release.

I build from svn sources. From the sources:
public void doInternalDispatch() throws ServletException, IOException {
        if (this.state.compareAndSet(AsyncState.TIMING_OUT,
AsyncState.COMPLETING)) {
            log.debug("TIMING OUT!");
            boolean listenerInvoked = false;
            for (AsyncListenerWrapper listener : listeners) {
                listener.fireOnTimeout(event);
                listenerInvoked = true;
            }
            if (listenerInvoked) {
                // Listener should have called complete
                if (state.get() != AsyncState.NOT_STARTED) {
                    ((HttpServletResponse)servletResponse).setStatus(500);
                    doInternalComplete(true);
                }
           .......

When timeout AsyncState is COMPLETING. But complete method do nothing to
COMPLETING state:
public void complete() {
        if (log.isDebugEnabled()) {
            log.debug("AsyncContext Complete Called["+state.get()+";
"+request.getRequestURI()+"?"+request.getQueryString()+"]", new
DebugException());
        }
        if (state.get()==AsyncState.COMPLETING) {
            //do nothing
        }

So always return http500. It has changed since svn revision 966548.In revision
960692 is below:

ublic void doInternalDispatch() throws ServletException, IOException {
        if (this.state.compareAndSet(AsyncState.TIMING_OUT,
AsyncState.COMPLETING)) {
            log.debug("TIMING OUT!");
            boolean listenerInvoked = false;
            for (AsyncListenerWrapper listener : listeners) {
                listener.fireOnTimeout(event);
                listenerInvoked = true;
            }
            if (!listenerInvoked) {
                ((HttpServletResponse)servletResponse).setStatus(500);
            }
            doInternalComplete(true);

-- 
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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to