yuchuanchen commented on code in PR #16927:
URL: https://github.com/apache/flink/pull/16927#discussion_r958281789


##########
flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopRecoverableFsDataOutputStream.java:
##########
@@ -171,10 +189,20 @@ private static void safelyTruncateFile(
         }
 
         if (!truncated) {
-            // Truncate did not complete immediately, we must wait for
-            // the operation to complete and release the lease.
-            revokeLeaseByFileSystem(fileSystem, path);
+            // Truncate does not complete immediately if block recovery is 
needed,
+            // thus wait for block recovery
+            LOG.debug("Waiting for block recovery for file {}.", path);
+            boolean recovered = waitForBlockRecovery(fileSystem, path);
+            if (!recovered) {
+                throw new IOException(
+                        String.format(
+                                "Failed to recover blocks for file %s in %d 
ms.",
+                                path.toString(), BLOCK_RECOVERY_TIMEOUT_MS));
+            }

Review Comment:
   Should the revokeLeaseByFileSystem() called after blockrecovery?



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

Reply via email to