You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/03/24 15:57:09 UTC

svn commit: r1580869 - /tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

Author: markt
Date: Mon Mar 24 14:57:09 2014
New Revision: 1580869

URL: http://svn.apache.org/r1580869
Log:
Another unit test run failure on OSX and a more careful review. Handle the case where timeout completes request before the Runnable's error handling does.

Modified:
    tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1580869&r1=1580868&r2=1580869&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java Mon Mar 24 14:57:09 2014
@@ -348,9 +348,17 @@ public class TestCoyoteAdapter extends T
                             os.flush();
                             Thread.sleep(1000);
                         } catch (Exception e) {
-                            asyncCtxt.complete();
-                            completed = true;
-                            break;
+                            try {
+                                // Note if request times out before this
+                                // exception is thrown and the complete call
+                                // below is made, the complete call below will
+                                // fail since the timeout will have completed
+                                // the request.
+                                asyncCtxt.complete();
+                                break;
+                            } finally {
+                                completed = true;
+                            }
                         }
                     }
                 }



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