cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r999646 - in /cassandra: branches/cassandra-0.6/src/java/org/apache/cassandra/net/IncomingTcpConnection.java trunk/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
Date Tue, 21 Sep 2010 21:16:44 GMT
Author: brandonwilliams
Date: Tue Sep 21 21:16:38 2010
New Revision: 999646

URL: http://svn.apache.org/viewvc?rev=999646&view=rev
Log:
Close storage port sockets on exceptions.  Patch by brandonwilliams, reviewed by Nate McCall
for CASSANDRA-1528

Modified:
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
    cassandra/trunk/src/java/org/apache/cassandra/net/IncomingTcpConnection.java

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/net/IncomingTcpConnection.java?rev=999646&r1=999645&r2=999646&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
Tue Sep 21 21:16:38 2010
@@ -80,12 +80,30 @@ public class IncomingTcpConnection exten
             {
                 if (logger.isTraceEnabled())
                     logger.trace("eof reading from socket; closing", e);
+                try
+                {
+                    socket.close();
+                }
+                catch (IOException e2)
+                {
+                    if (logger.isDebugEnabled())
+                        logger.debug("error closing socket", e2);
+                }
                 break;
             }
-            catch (IOException e)
+            catch (IOException e) 
             {
                 if (logger.isDebugEnabled())
                     logger.debug("error reading from socket; closing", e);
+                try
+                {
+                    socket.close();
+                }
+                catch (IOException e2)
+                {
+                    if (logger.isDebugEnabled())
+                        logger.debug("error closing socket", e2);
+                }
                 break;
             }
         }

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/IncomingTcpConnection.java?rev=999646&r1=999645&r2=999646&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/IncomingTcpConnection.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/IncomingTcpConnection.java Tue Sep 21
21:16:38 2010
@@ -86,12 +86,30 @@ public class IncomingTcpConnection exten
             {
                 if (logger.isTraceEnabled())
                     logger.trace("eof reading from socket; closing", e);
+                try
+                {
+                    socket.close();
+                }
+                catch (IOException e2)
+                {
+                    if (logger.isDebugEnabled())
+                        logger.debug("error closing socket", e2);
+                }
                 break;
             }
-            catch (IOException e)
+            catch (IOException e) 
             {
                 if (logger.isDebugEnabled())
                     logger.debug("error reading from socket; closing", e);
+                try
+                {
+                    socket.close();
+                }
+                catch (IOException e2)
+                {
+                    if (logger.isDebugEnabled())
+                        logger.debug("error closing socket", e2);
+                }
                 break;
             }
         }



Mime
View raw message