ZanderXu opened a new pull request, #5500:
URL: https://github.com/apache/hadoop/pull/5500
### Description of PR
The blockReport RPC should throw UnregisteredNodeException when the storedDN
is null, the related code as bellows:
```
public void removeBRLeaseIfNeeded(final DatanodeID nodeID,
final BlockReportContext context) throws IOException {
namesystem.writeLock();
DatanodeDescriptor node;
try {
// Here, if the node is null, we should throw
UnregisteredNodeException insteat of NPE
node = datanodeManager.getDatanode(nodeID);
if (context != null) {
if (context.getTotalRpcs() == context.getCurRpc() + 1) {
long leaseId = this.getBlockReportLeaseManager().removeLease(node);
BlockManagerFaultInjector.getInstance().
removeBlockReportLease(node, leaseId);
node.setLastBlockReportTime(now());
node.setLastBlockReportMonotonic(Time.monotonicNow());
}
if (LOG.isDebugEnabled()) {
LOG.debug("Processing RPC with index {} out of total {} RPCs in
processReport 0x{}",
context.getCurRpc(), context.getTotalRpcs(),
Long.toHexString(context.getReportId()));
}
}
} finally {
namesystem.writeUnlock("removeBRLeaseIfNeeded");
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]