HDFS-10688. BPServiceActor may run into a tight loop for sending block report when hitting IOException. Contributed by Chen Liang.
This commit is contained in:
parent
d383bfdcd4
commit
0cde9e12a7
@ -649,18 +649,23 @@ private void offerService() throws Exception {
|
||||
return;
|
||||
}
|
||||
LOG.warn("RemoteException in offerService", re);
|
||||
sleepAfterException();
|
||||
} catch (IOException e) {
|
||||
LOG.warn("IOException in offerService", e);
|
||||
sleepAfterException();
|
||||
}
|
||||
processQueueMessages();
|
||||
} // while (shouldRun())
|
||||
} // offerService
|
||||
|
||||
private void sleepAfterException() {
|
||||
try {
|
||||
long sleepTime = Math.min(1000, dnConf.heartBeatInterval);
|
||||
Thread.sleep(sleepTime);
|
||||
} catch (InterruptedException ie) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOG.warn("IOException in offerService", e);
|
||||
}
|
||||
processQueueMessages();
|
||||
} // while (shouldRun())
|
||||
} // offerService
|
||||
|
||||
/**
|
||||
* Register one bp with the corresponding NameNode
|
||||
|
Loading…
Reference in New Issue
Block a user