[ 
https://issues.apache.org/jira/browse/FLINK-7897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16417286#comment-16417286
 ] 

ASF GitHub Bot commented on FLINK-7897:
---------------------------------------

Github user yuqi1129 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5777#discussion_r177736130
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/blob/TransientBlobCleanupTask.java
 ---
    @@ -100,9 +102,15 @@ public void run() {
                                writeLock.lock();
     
                                try {
    -                                   if (!localFile.delete() && 
localFile.exists()) {
    -                                           log.warn("Failed to locally 
delete blob " + localFile.getAbsolutePath());
    -                                   } else {
    +                                   try {
    --- End diff --
    
    According to code before, entries will be deleted if no exception occur 
whether file was deleted or not. As for you code logic, if We failed to delete 
file, entries will stay in the Map. 


> Consider using nio.Files for file deletion in TransientBlobCleanupTask
> ----------------------------------------------------------------------
>
>                 Key: FLINK-7897
>                 URL: https://issues.apache.org/jira/browse/FLINK-7897
>             Project: Flink
>          Issue Type: Improvement
>          Components: Local Runtime
>            Reporter: Ted Yu
>            Assignee: vinoyang
>            Priority: Minor
>
> nio.Files#delete() provides better clue as to why the deletion may fail:
> https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#delete(java.nio.file.Path)
> Depending on the potential exception (FileNotFound), the call to 
> localFile.exists() may be skipped.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to