Author: markt
Date: Tue Feb 17 19:25:07 2015
New Revision: 1660470

URL: http://svn.apache.org/r1660470
Log:
After a few wrong turns, take another stab at some debug logging for the 
ocassional NIO2 failure in the CI build. I don't expect this to find the 
problem, just point us in the right direction.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
    tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeProcessor.java
    
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties?rev=1660470&r1=1660469&r2=1660470&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties 
Tue Feb 17 19:25:07 2015
@@ -15,6 +15,9 @@
 
 upgradeProcessor.isCloseFail=Failed to close input stream associated with 
upgraded connection
 upgradeProcessor.osCloseFail=Failed to close output stream associated with 
upgraded connection
+upgradeProcessor.requiredClose=Closing upgraded connection due to 
closeRequired state of streams: Input [{0}], Output [{1}]
+upgradeProcessor.stop=Closing upgraded connection as incoming socket status 
was STOP
+upgradeProcessor.unexpectedState=Closing upgraded connection unexpectedly as 
incoming socket status was [{0}]
 
 upgrade.sis.errorCloseFail=Failed to close InputStream cleanly after a 
previous error
 upgrade.sis.isFinished.ise=It is illegal to call isFinished() when the 
ServletInputStream is not in non-blocking mode (i.e. setReadListener() must be 
called first)

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeProcessor.java?rev=1660470&r1=1660469&r2=1660470&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeProcessor.java 
Tue Feb 17 19:25:07 2015
@@ -103,6 +103,9 @@ public class UpgradeProcessor implements
         } else if (status == SocketStatus.OPEN_WRITE) {
             upgradeServletOutputStream.onWritePossible();
         } else if (status == SocketStatus.STOP) {
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("upgradeProcessor.stop"));
+            }
             try {
                 upgradeServletInputStream.close();
             } catch (IOException ioe) {
@@ -116,10 +119,18 @@ public class UpgradeProcessor implements
             return SocketState.CLOSED;
         } else {
             // Unexpected state
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("upgradeProcessor.unexpectedState"));
+            }
             return SocketState.CLOSED;
         }
         if (upgradeServletInputStream.isCloseRequired() ||
                 upgradeServletOutputStream.isCloseRequired()) {
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("upgradeProcessor.requiredClose",
+                        
Boolean.valueOf(upgradeServletInputStream.isCloseRequired()),
+                        
Boolean.valueOf(upgradeServletOutputStream.isCloseRequired())));
+            }
             return SocketState.CLOSED;
         }
         return SocketState.UPGRADED;

Modified: 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java?rev=1660470&r1=1660469&r2=1660470&view=diff
==============================================================================
--- 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java 
(original)
+++ 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java 
Tue Feb 17 19:25:07 2015
@@ -47,6 +47,8 @@ public class TestWebSocketFrameClientSSL
     public void testConnectToServerEndpoint() throws Exception {
         Logger logger = 
Logger.getLogger("org.apache.tomcat.util.net.Nio2Endpoint");
         logger.setLevel(Level.ALL);
+        logger = 
Logger.getLogger("org.apache.coyote.http11.upgrade.UpgradeProcessor");
+        logger.setLevel(Level.ALL);
         Tomcat tomcat = getTomcatInstance();
         // No file system docBase required
         Context ctx = tomcat.addContext("", null);



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

Reply via email to