hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject [25/33] hadoop git commit: HDFS-11508. Fix bind failure in SimpleTCPServer & Portmap where bind fails because socket is in TIME_WAIT state. Contributed by Mukul Kumar Singh.
Date Wed, 08 Mar 2017 23:46:23 GMT
HDFS-11508. Fix bind failure in SimpleTCPServer & Portmap where bind fails because socket
is in TIME_WAIT state. Contributed by Mukul Kumar Singh.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/0a176212
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/0a176212
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/0a176212

Branch: refs/heads/HDFS-7240
Commit: 0a1762125c6f39705f6cad8f084de746d0890c0a
Parents: 647de3c
Author: Arpit Agarwal <arp@apache.org>
Authored: Tue Mar 7 11:41:05 2017 -0800
Committer: Anu Engineer <aengineer@apache.org>
Committed: Wed Mar 8 15:34:02 2017 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/oncrpc/SimpleTcpServer.java    | 1 +
 .../src/main/java/org/apache/hadoop/portmap/Portmap.java           | 2 ++
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/0a176212/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/SimpleTcpServer.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/SimpleTcpServer.java
b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/SimpleTcpServer.java
index 99d1d6f..f7ab52e 100644
--- a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/SimpleTcpServer.java
+++ b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/SimpleTcpServer.java
@@ -81,6 +81,7 @@ public class SimpleTcpServer {
     });
     server.setOption("child.tcpNoDelay", true);
     server.setOption("child.keepAlive", true);
+    server.setOption("reuseAddress", true);
 
     // Listen to TCP port
     ch = server.bind(new InetSocketAddress(port));

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0a176212/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/portmap/Portmap.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/portmap/Portmap.java
b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/portmap/Portmap.java
index 2b88791..94d76d0 100644
--- a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/portmap/Portmap.java
+++ b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/portmap/Portmap.java
@@ -109,12 +109,14 @@ final class Portmap {
             RpcUtil.STAGE_RPC_TCP_RESPONSE);
       }
     });
+    tcpServer.setOption("reuseAddress", true);
 
     udpServer = new ConnectionlessBootstrap(new NioDatagramChannelFactory(
         Executors.newCachedThreadPool()));
 
     udpServer.setPipeline(Channels.pipeline(RpcUtil.STAGE_RPC_MESSAGE_PARSER,
         handler, RpcUtil.STAGE_RPC_UDP_RESPONSE));
+    udpServer.setOption("reuseAddress", true);
 
     tcpChannel = tcpServer.bind(tcpAddress);
     udpChannel = udpServer.bind(udpAddress);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message