HADOOP-17068. Client fails forever when namenode ipaddr changed. Contributed by Sean Chow.
(cherry picked from commitfa14e4bc00
) (cherry picked from commit3a860e876e
) (cherry picked from commit8d7600ae6b
) (cherry picked from commit1fe15113cf
)
This commit is contained in:
parent
35c99be3da
commit
2c45e93682
|
@ -652,6 +652,7 @@ public class Client implements AutoCloseable {
|
||||||
|
|
||||||
private synchronized void setupConnection(
|
private synchronized void setupConnection(
|
||||||
UserGroupInformation ticket) throws IOException {
|
UserGroupInformation ticket) throws IOException {
|
||||||
|
LOG.debug("Setup connection to " + server.toString());
|
||||||
short ioFailures = 0;
|
short ioFailures = 0;
|
||||||
short timeoutFailures = 0;
|
short timeoutFailures = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -713,8 +714,16 @@ public class Client implements AutoCloseable {
|
||||||
} catch (IOException ie) {
|
} catch (IOException ie) {
|
||||||
if (updateAddress()) {
|
if (updateAddress()) {
|
||||||
timeoutFailures = ioFailures = 0;
|
timeoutFailures = ioFailures = 0;
|
||||||
}
|
try {
|
||||||
|
// HADOOP-17068: when server changed, ignore the exception.
|
||||||
handleConnectionFailure(ioFailures++, ie);
|
handleConnectionFailure(ioFailures++, ie);
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
LOG.warn("Exception when handle ConnectionFailure: "
|
||||||
|
+ ioe.getMessage());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handleConnectionFailure(ioFailures++, ie);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1279,7 +1288,7 @@ public class Client implements AutoCloseable {
|
||||||
cleanupCalls();
|
cleanupCalls();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// log the info
|
// Log the newest server information if update address.
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("closing ipc connection to " + server + ": " +
|
LOG.debug("closing ipc connection to " + server + ": " +
|
||||||
closeException.getMessage(),closeException);
|
closeException.getMessage(),closeException);
|
||||||
|
|
Loading…
Reference in New Issue