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 2015/02/17 15:55:52 UTC

svn commit: r1660402 - in /tomcat/trunk: java/org/apache/coyote/AbstractProtocol.java test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java

Author: markt
Date: Tue Feb 17 14:55:52 2015
New Revision: 1660402

URL: http://svn.apache.org/r1660402
Log:
Additional debug logging to try and trace the cause of the occasional NIO2 failures for TestWebSocketFrameClientSSL.

Modified:
    tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
    tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1660402&r1=1660401&r2=1660402&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Tue Feb 17 14:55:52 2015
@@ -601,12 +601,18 @@ public abstract class AbstractProtocol<S
                 SocketStatus status) {
             if (wrapper == null) {
                 // Nothing to do. Socket has been closed.
+                if (getLog().isDebugEnabled()) {
+                    getLog().debug("Wrapper is null. Closing connection.");
+                }
                 return SocketState.CLOSED;
             }
 
             S socket = wrapper.getSocket();
             if (socket == null) {
                 // Nothing to do. Socket has been closed.
+                if (getLog().isDebugEnabled()) {
+                    getLog().debug("Socket is null. Closing connection.");
+                }
                 return SocketState.CLOSED;
             }
 
@@ -614,6 +620,9 @@ public abstract class AbstractProtocol<S
             if (status == SocketStatus.DISCONNECT && processor == null) {
                 // Nothing to do. Endpoint requested a close and there is no
                 // longer a processor associated with this socket.
+                if (getLog().isDebugEnabled()) {
+                    getLog().debug("SocketStatus.DISCONNECT && processor == null. Closing connection.");
+                }
                 return SocketState.CLOSED;
             }
 
@@ -636,6 +645,9 @@ public abstract class AbstractProtocol<S
                 do {
                     if (status == SocketStatus.CLOSE_NOW) {
                         processor.errorDispatch();
+                        if (getLog().isDebugEnabled()) {
+                            getLog().debug("SocketStatus.CLOSE_NOW. Closing connection.");
+                        }
                         state = SocketState.CLOSED;
                     } else if (dispatches != null) {
                         // Associate the processor with the connection as
@@ -739,6 +751,9 @@ public abstract class AbstractProtocol<S
                     } else {
                         release(wrapper, processor, false);
                     }
+                    if (getLog().isDebugEnabled()) {
+                        getLog().debug("Closing connection.");
+                    }
                 }
                 return state;
             } catch(java.net.SocketException e) {

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=1660402&r1=1660401&r2=1660402&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java Tue Feb 17 14:55:52 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.Http11Nio2Protocol");
+        logger.setLevel(Level.ALL);
         Tomcat tomcat = getTomcatInstance();
         // No file system docBase required
         Context ctx = tomcat.addContext("", null);



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