geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [23/50] [abbrv] incubator-geode git commit: Revert "GEODE-871: build-up of sockets in TIME_WAIT on locator machine"
Date Mon, 01 Feb 2016 20:55:40 GMT
Revert "GEODE-871: build-up of sockets in TIME_WAIT on locator machine"

This reverts commit c01506b27e233538ecc2ca5a81ca113c15cc388a.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0994a45b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0994a45b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0994a45b

Branch: refs/heads/feature/GEODE-773-2
Commit: 0994a45b5a584925b3c646b8b9607047c7869531
Parents: de7afae
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Fri Jan 29 08:42:07 2016 -0800
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Fri Jan 29 08:42:50 2016 -0800

----------------------------------------------------------------------
 .../distributed/internal/tcpserver/TcpClient.java  |  8 +++-----
 .../distributed/internal/tcpserver/TcpServer.java  | 17 ++++++++++++++++-
 2 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0994a45b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
index 836416b..47f50b3 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
@@ -167,15 +167,14 @@ public class TcpClient {
       }
       return null;
     } finally {
+      if (out != null) {
+        out.close();
+      }
       try {
-        sock.setSoLinger(true, 0); // initiate an abort on close to shut down the locator's
socket
         sock.close();
       } catch(Exception e) {
         logger.error("Error closing socket ", e);
       }
-      if (out != null) {
-        out.close();
-      }
     }
   }
 
@@ -224,7 +223,6 @@ public class TcpClient {
       }
     } finally {
       try {
-        sock.setSoLinger(true, 0); // initiate an abort on close to shut down the server's
socket
         sock.close();
       } catch(Exception e) {
         logger.error("Error closing socket ", e);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0994a45b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServer.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServer.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServer.java
index e5ad416..f52b9ab 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServer.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServer.java
@@ -398,6 +398,7 @@ public class TcpServer {
             DataSerializer.writeObject(response, output);
 
             output.flush();
+            output.close();
           }
 
           handler.endResponse(request,startTime);
@@ -466,10 +467,24 @@ public class TcpServer {
             t.printStackTrace();
           }
         } finally {
+          // Normal path closes input first, so let's do that here...
+          if (input != null) {
+            try {
+              input.close();
+            } catch (IOException e) {
+              log.warn(
+                "Exception closing input stream", e);
+            }
+          }
+
+          // Closing the ObjectInputStream is supposed to close
+          // the underlying InputStream, but we do it here just for
+          // good measure. Closing a closed socket is a no-op.
           try {
             sock.close();
           } catch (IOException e) {
-            // ignore
+            log.warn(
+                "Exception closing socket", e);
           }
         }
       }


Mime
View raw message