jojochuang commented on code in PR #6094:
URL: https://github.com/apache/ozone/pull/6094#discussion_r1468018387


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestLeaseRecovery.java:
##########
@@ -433,6 +433,27 @@ public void testRecoverWrongFile() throws Exception {
     }
   }
 
+  @Test
+  public void testRecoveryWithoutBlocks() throws Exception {
+    RootedOzoneFileSystem fs = (RootedOzoneFileSystem)FileSystem.get(conf);
+
+    final FSDataOutputStream stream = fs.create(file, true);
+    try {
+      stream.hsync();
+      assertFalse(fs.isFileClosed(file));
+
+      int count = 0;
+      while (count++ < 15 && !fs.recoverLease(file)) {
+        Thread.sleep(1000);
+      }
+      // The lease should have been recovered.
+      assertTrue(fs.isFileClosed(file), "File should be closed");
+
+    } finally {
+      closeIgnoringKeyNotFound(stream);

Review Comment:
   Ok let's revisit later.



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