瀏覽代碼

HADOOP-9898. Set SO_KEEPALIVE on all our sockets. Contributed by Todd Lipcon.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.2@1537639 13f79535-47bb-0310-9956-ffa450edef68
Andrew Wang 11 年之前
父節點
當前提交
8d3f90b3c1

+ 2 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -38,6 +38,8 @@ Release 2.2.1 - UNRELEASED
     HADOOP-10072. TestNfsExports#testMultiMatchers fails due to non-deterministic
     HADOOP-10072. TestNfsExports#testMultiMatchers fails due to non-deterministic
     timing around cache expiry check. (cnauroth)
     timing around cache expiry check. (cnauroth)
 
 
+    HADOOP-9898. Set SO_KEEPALIVE on all our sockets. (todd via wang)
+
 Release 2.2.0 - 2013-10-13
 Release 2.2.0 - 2013-10-13
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 1 - 0
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java

@@ -522,6 +522,7 @@ public class Client {
         try {
         try {
           this.socket = socketFactory.createSocket();
           this.socket = socketFactory.createSocket();
           this.socket.setTcpNoDelay(tcpNoDelay);
           this.socket.setTcpNoDelay(tcpNoDelay);
+          this.socket.setKeepAlive(true);
           
           
           /*
           /*
            * Bind the socket to the host specified in the principal name of the
            * Bind the socket to the host specified in the principal name of the

+ 1 - 0
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java

@@ -759,6 +759,7 @@ public abstract class Server {
 
 
         channel.configureBlocking(false);
         channel.configureBlocking(false);
         channel.socket().setTcpNoDelay(tcpNoDelay);
         channel.socket().setTcpNoDelay(tcpNoDelay);
+        channel.socket().setKeepAlive(true);
         
         
         Reader reader = getReader();
         Reader reader = getReader();
         try {
         try {