HDFS-6330. Merge r1602484 from trunk.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1602485 13f79535-47bb-0310-9956-ffa450edef68
HDFS-6470. TestBPOfferService.testBPInitErrorHandling is flaky. Contributed by Ming Ma.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1602491 13f79535-47bb-0310-9956-ffa450edef68