Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6103

LocalFileSystem rename() uses File.renameTo()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: Local Runtime
    • Labels:
    • Flags:
      Important

      Description

      I've tried to move a directory to another on the LocalFilesystem and it doesn't work (in my case fs is an instance of java.io.UnixFileSystem).
      As for Flink-1840 (there was a PR to fix the issue - https://github.com/apache/flink/pull/578) the problem is that File.renameTo() is not reliable.

      Indeed, the Javadoc says:

      Renames the file denoted by this abstract pathname. Many aspects of the behavior of this method are inherently platform-dependent: The rename operation might not be able to move a file from one filesystem to another, it might not be atomic, and it might not succeed if a file with the destination abstract pathname already exists. The return value should always be checked to make sure that the rename operation was successful. Note that the java.nio.file.Files class defines the move method to move or rename a file in a platform independent manner

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                f.pompermaier Flavio Pompermaier
                Reporter:
                f.pompermaier Flavio Pompermaier
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: