HADOOP-12653. Use SO_REUSEADDR to avoid getting "Address already in use" when using kerberos and attempting to bind to any port on the local IP address (cmccabe)
(cherry picked from commit 30c7dfd8ba87fe1b455ad6c05c0a6cd6486f55b7)
This commit is contained in:
parent
5e2416b901
commit
181437cccf
@ -18,6 +18,10 @@ Release 2.9.0 - UNRELEASED
|
||||
HADOOP-12663. Remove Hard-Coded Values From FileSystem.java.
|
||||
(BELUGA BEHR via stevel)
|
||||
|
||||
HADOOP-12653. Use SO_REUSEADDR to avoid getting "Address already in use"
|
||||
when using kerberos and attempting to bind to any port on the local IP
|
||||
address (cmccabe)
|
||||
|
||||
BUG FIXES
|
||||
|
||||
HADOOP-12655. TestHttpServer.testBindAddress bind port range is wider
|
||||
|
@ -625,6 +625,7 @@ private synchronized void setupConnection() throws IOException {
|
||||
// If host name is a valid local address then bind socket to it
|
||||
InetAddress localAddr = NetUtils.getLocalInetAddress(host);
|
||||
if (localAddr != null) {
|
||||
this.socket.setReuseAddress(true);
|
||||
this.socket.bind(new InetSocketAddress(localAddr, 0));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user