You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/02/06 11:41:41 UTC

[jira] [Commented] (FLINK-5659) FileBaseUtils#deleteFileOrDirectory not thread-safe on Windows

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

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

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

    https://github.com/apache/flink/pull/3219#discussion_r99568502
  
    --- Diff: flink-core/src/main/java/org/apache/flink/util/FileUtils.java ---
    @@ -116,6 +118,14 @@ else if (file.exists()) {
     			}
     			catch (NoSuchFileException e) {
     				// if the file is already gone (concurrently), we don't mind
    +			} catch (AccessDeniedException e) {
    --- End diff --
    
    Is it ok to special case this inside the catch block? (I.e for windows check again, otherwise rethrow?


> FileBaseUtils#deleteFileOrDirectory not thread-safe on Windows
> --------------------------------------------------------------
>
>                 Key: FLINK-5659
>                 URL: https://issues.apache.org/jira/browse/FLINK-5659
>             Project: Flink
>          Issue Type: Bug
>          Components: Core, Local Runtime
>    Affects Versions: 1.2.0, 1.3.0
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>            Priority: Trivial
>
> The {code}FileBaseUtils#deleteFileOrDirectory{code} is not thread-safe on Windows.
> First you will run into AccessDeniedExceptions since one thread tried to delete a file while another thread was already doing that, for which the file has to be opened.
> Once you resolve those exceptions (by catching them double checking whether the file still exists), you run into DirectoryNotEmptyExceptions since there is some wacky timing/visibility issue when deleting files concurrently.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)