goiri commented on code in PR #4820:
URL: https://github.com/apache/hadoop/pull/4820#discussion_r957541656


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java:
##########
@@ -135,6 +142,10 @@ static enum RunningState {
         dnConf.getLifelineIntervalMs(), dnConf.blockReportInterval,
         dnConf.outliersReportIntervalMs);
     // get the value of maxDataLength.
+    sendIBRLock = new Object();
+    ibrExecutorService = Executors.newSingleThreadExecutor(

Review Comment:
   ```
   ThreadFactory threadFactory = new ThreadFactoryBuilder()
       .setDaemon(true)
       .setNameFormat("IBR-executor-%d")
       .build()
   ibrExecutorService = Executors.newSingleThreadExecutor(threadFactory);
   ```



##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestIncrementalBlockReports.java:
##########
@@ -166,13 +167,28 @@ public void testReportBlockDeleted() throws 
InterruptedException, IOException {
 
       // Trigger a heartbeat, this also triggers an IBR.
       DataNodeTestUtils.triggerHeartbeat(singletonDn);
-      Thread.sleep(2000);
 
       // Ensure that the deleted block is reported.
       Mockito.verify(nnSpy, times(1)).blockReceivedAndDeleted(
           any(DatanodeRegistration.class),
           anyString(),
           any(StorageReceivedDeletedBlocks[].class));
+      int retries = 0;

Review Comment:
   LambdaTestUtils#waitFor



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java:
##########
@@ -1275,4 +1299,5 @@ public long monotonicNow() {
       return Time.monotonicNow();
     }
   }
+

Review Comment:
   Avoid



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java:
##########
@@ -243,13 +243,18 @@ ReplicaInfo fetchReplicaInfo(String bpid, long blockId) {
   @Override // FsDatasetSpi
   public LengthInputStream getMetaDataInputStream(ExtendedBlock b)
       throws IOException {
-    File meta = FsDatasetUtil.getMetaFile(getBlockFile(b), 
b.getGenerationStamp());
-    FsVolumeSpi volume = null;
+    File meta = null;
+    try {
+      meta = FsDatasetUtil.getMetaFile(getBlockFile(b), 
b.getGenerationStamp());
+    } catch (IOException e) {
+      throw new FileNotFoundException("BlockId " + b.getBlockName() + " is not 
valid.");

Review Comment:
   How did the old exception look like?



-- 
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]

Reply via email to