tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 59220] New: AsyncListener#onComplete not called after timeout if buffer is flushed
Date Wed, 23 Mar 2016 13:17:59 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=59220

            Bug ID: 59220
           Summary: AsyncListener#onComplete not called after timeout if
                    buffer is flushed
           Product: Tomcat 8
           Version: 8.0.32
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: niscomar@googlemail.com

If an async dispatch cycle is started and a timeout occurs before the response
buffer is flushed using response#flushBuffer(), then the
AsyncListener#onTimeout()
method followed by the AsyncListener#onComplete() are correctly called.

However, if the buffer is flushed before the timeout occurs, the 
AsyncListener#onTimeout() method will be called, but the 
AsyncListener#onComplete() will not be.

A sample servlet demonstrating the problem, AsyncDebugListener, is provided 
at the following location:

https://github.com/msnicklous/AsyncDebug

Build the AsyncDebugListener module using 'mvn install' and deploy it on
Tomcat.

The service method and each of the AsyncListener methods logs output to the
AsyncListener.log file. You can follow execution by looking at the logs.

Assuming Tomcat is installed locally, you can use the following URLs:

1) No timeout - works correctly:

http://localhost:8080/AsyncDebugListener/ltest?reps=3

2) Timeout, no flush - works correctly:

http://localhost:8080/AsyncDebugListener/ltest?reps=3&timeout

3) Flush before timeout - error case:

http://localhost:8080/AsyncDebugListener/ltest?reps=3&timeout&flush

>From the logs, you will see that AsyncListener#onTimeout() was called, but  
AsyncListener#onComplete() was not.

Thanks for having a look at this!

-- 
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


Mime
View raw message