HDFS-11387. Socket reuse address option is not honored in PrivilegedNfsGatewayStarter. Contributed by Mukul Kumar Singh.
This commit is contained in:
parent
0914fcca31
commit
e0235842a7
@ -54,9 +54,11 @@ public void init(DaemonContext context) throws Exception {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
registrationSocket = new DatagramSocket(
|
InetSocketAddress socketAddress =
|
||||||
new InetSocketAddress("localhost", clientPort));
|
new InetSocketAddress("localhost", clientPort);
|
||||||
|
registrationSocket = new DatagramSocket(null);
|
||||||
registrationSocket.setReuseAddress(true);
|
registrationSocket.setReuseAddress(true);
|
||||||
|
registrationSocket.bind(socketAddress);
|
||||||
} catch (SocketException e) {
|
} catch (SocketException e) {
|
||||||
LOG.error("Init failed for port=" + clientPort, e);
|
LOG.error("Init failed for port=" + clientPort, e);
|
||||||
throw e;
|
throw e;
|
||||||
|
Loading…
Reference in New Issue
Block a user