BPOfferService.blockReport should call blockReportCompleted in a finnaly
Auto generated commit msg.
@@ -1090,6 +1090,9 @@ void notifyNamenodeDeletedBlockInt(
// Get a namenode to send the report(s) to
ActiveNode an = nextNNForBlkReport(totalBlockCount);
+ int numReportsSent;
+ long brSendStartTime;
+ try {
if (an != null) {
blkReportHander = getAnActor(an.getRpcServerAddressForDatanodes());
if (blkReportHander == null || !blkReportHander.isRunning()) {
@@ -1101,8 +1104,7 @@ void notifyNamenodeDeletedBlockInt(
}
// Send the reports to the NN.
- int numReportsSent;
- long brSendStartTime = now();
+ brSendStartTime = now();
if (totalBlockCount < dnConf.blockReportSplitThreshold) {
// Below split threshold, send all reports in a single message.
numReportsSent = 1;
@@ -1123,9 +1125,11 @@ void notifyNamenodeDeletedBlockInt(
}
}
}
-
- LOG.info("Block report completed");
+ } finally {
+ // In case of un/successful block reports we have to inform the leader that
+ // block reporting has finished for now.
getLeaderActor().blockReportCompleted(bpRegistration);
+ }
// Log the block report processing stats from Datanode perspective
long brSendCost = now() - brSendStartTime;
