tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1767471 - in /tomcat/trunk: java/org/apache/coyote/AbstractProcessor.java java/org/apache/coyote/AsyncStateMachine.java webapps/docs/changelog.xml
Date Tue, 01 Nov 2016 10:21:20 GMT
Author: markt
Date: Tue Nov  1 10:21:20 2016
New Revision: 1767471

URL: http://svn.apache.org/viewvc?rev=1767471&view=rev
Log:
If an I/O error occurs during async processing on a non-container thread, ensure that the
onError() event is triggered.

Modified:
    tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java
    tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java?rev=1767471&r1=1767470&r2=1767471&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java Tue Nov  1 10:21:20 2016
@@ -103,6 +103,9 @@ public abstract class AbstractProcessor
                 response.setStatus(500);
             }
             getLog().info(sm.getString("abstractProcessor.nonContainerThreadError"), t);
+            // Set the request attribute so that the async onError() event is
+            // fired when the error event is processed
+            request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
             socketWrapper.processSocket(SocketEvent.ERROR, true);
         }
     }

Modified: tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java?rev=1767471&r1=1767470&r2=1767471&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java [UTF-8] (original)
+++ tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java [UTF-8] Tue Nov  1 10:21:20
2016
@@ -69,30 +69,30 @@ import org.apache.tomcat.util.security.P
  * ERROR            - Something went wrong.
  *
  * |-----------------»------|
- * |                       \|/
- * |   |----------«-------ERROR-----------------------------------«-------------------------------|
- * |   |      complete() /|\/|\\                                                        
         |
- * |   |                  |  |  \                                                       
         |
- * |   |    |-----»-------|  |   \-----------»----------|                             
           |
- * |   |    |                |                          |dispatch()                     
         |
- * |   |    |                |                         \|/                              
         |
- * |   |    |                |          |--|timeout()   |                               
         |
- * |   |    |     post()     |          | \|/           |     post()                    
         |
- * |   |    |    |---------- | --»DISPATCHED«---------- | --------------COMPLETING«-----|
        |
- * |   |    |    |           |   /|\/|\ |               |                | /|\ /|\      |
        |
- * |   |    |    |    |---»- | ---|  |  |startAsync()   |       timeout()|--|   |      
|         |
- * |   |    ^    ^    |      |       |  |               |                       |       |
        |
- * |   |    |    |    |   |-- \ -----|  |   complete()  |                       |post() |
        |
- * |   |    |    |    |   |    \        |     /--»----- | ---COMPLETE_PENDING-»-|     
 |         |
- * |   |    |    |    |   |     \       |    /          |                               |
        |
- * |   |    |    |    |   ^      \      |   /           |                               |
        |
- * |  \|/   |    |    |   |       \    \|/ /   post()   |                               |
        |
- * | MUST_COMPLETE-«- | - | --«----STARTING--»--------- | -------------|             
  ^         |
- * |  /|\    /|\      |   |  complete()  | \            |              |     complete() |
        |
- * |   |      |       |   |              |  \           |    post()    |     /----------|
        |
- * |   |      |       ^   |    dispatch()|   \          |    |-----|   |    /           
         |
- * |   |      |       |   |              |    \         |    |     |   |   /            
         |
- * |   |      |       |   |             \|/    \        |    |    \|/ \|/ /       post()
         |
+ * |                       \|/ /-----------------------------------«------------------------------|
+ * |   |----------«-------ERROR----------------------------«-------------------------------|
     |
+ * |   |      complete() /|\/|\\                                                        
  |      |
+ * |   |                  |  |  \                                                       
  |      |
+ * |   |    |-----»-------|  |   \-----------»----------|                             
    |      |
+ * |   |    |                |                          |dispatch()                     
  |      |
+ * |   |    |                |                         \|/                              
  |      |
+ * |   |    |                |          |--|timeout()   |                               
  |      |
+ * |   |    |     post()     |          | \|/           |     post()                    
  |      |
+ * |   |    |    |---------- | --»DISPATCHED«---------- | --------------COMPLETING«-----|
 |      |
+ * |   |    |    |           |   /|\/|\ |               |                | /|\ /|\      |
 |      |
+ * |   |    |    |    |---»- | ---|  |  |startAsync()   |       timeout()|--|   |      
|  |      |
+ * |   |    ^    ^    |      |       |  |               |                       |       |
 ^      |
+ * |   |    |    |    |   |-- \ -----|  |   complete()  |                       |post() |
 |      |
+ * |   |    |    |    |   |    \        |     /--»----- | ---COMPLETE_PENDING-»-|     
 ^  |      |
+ * |   |    |    |    |   |     \       |    /          |                               |
 |      |
+ * |   |    |    |    |   ^      \      |   /           |                               |
 |      |
+ * |  \|/   |    |    |   |       \    \|/ /   post()   |                    complete() |
 |      |
+ * | MUST_COMPLETE-«- | - | --«----STARTING--»--------- | ------------|       /---»-----|
 |      |
+ * |  /|\    /|\      |   |  complete()  | \            |             |      /          
  |      ^
+ * |   |      |       |   |              |  \           |    post()   |     /   error() 
  |      |
+ * |   |      |       ^   |    dispatch()|   \          |    |-----|  |    //------»-------|
     |
+ * |   |      |       |   |              |    \         |    |     |  |   //            
         |
+ * |   |      |       |   |             \|/    \        |    |    \|/\|/ //       post()
         |
  * |   |      |       |   |--«--MUST_DISPATCH-----«-----|    |--«--STARTED«---------«---------|
  |
  * |   |      |       | dispatched() /|\   |     \                / |   |               
     |   |
  * |   |      |       |               |    |      \              /  |   |               
     |   |
@@ -386,6 +386,7 @@ public class AsyncStateMachine {
 
     public synchronized void asyncError() {
         if (state == AsyncState.STARTING ||
+                state == AsyncState.STARTED ||
                 state == AsyncState.DISPATCHED ||
                 state == AsyncState.TIMING_OUT ||
                 state == AsyncState.MUST_COMPLETE ||

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1767471&r1=1767470&r2=1767471&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Nov  1 10:21:20 2016
@@ -165,6 +165,11 @@
         use. The values used by the executor may be set and obtained via the
         Executor. (markt)
       </fix>
+      <fix>
+        If an I/O error occurs during async processing on a non-container
+        thread, ensure that the <code>onError()</code> event is triggered.
+        (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message