|
@@ -19,6 +19,7 @@ package org.apache.hadoop.hdfs.server.datanode;
|
|
|
|
|
|
import static org.apache.hadoop.util.Time.now;
|
|
|
|
|
|
+import java.io.EOFException;
|
|
|
import java.io.IOException;
|
|
|
import java.net.InetSocketAddress;
|
|
|
import java.net.SocketTimeoutException;
|
|
@@ -797,6 +798,10 @@ class BPServiceActor implements Runnable {
|
|
|
// Use returned registration from namenode with updated fields
|
|
|
bpRegistration = bpNamenode.registerDatanode(bpRegistration);
|
|
|
break;
|
|
|
+ } catch(EOFException e) { // namenode might have just restarted
|
|
|
+ LOG.info("Problem connecting to server: " + nnAddr + " :"
|
|
|
+ + e.getLocalizedMessage());
|
|
|
+ sleepAndLogInterrupts(1000, "connecting to server");
|
|
|
} catch(SocketTimeoutException e) { // namenode is busy
|
|
|
LOG.info("Problem connecting to server: " + nnAddr);
|
|
|
sleepAndLogInterrupts(1000, "connecting to server");
|