Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-16878

FileUtil.copy() to throw IOException if the source and destination are the same

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 3.3.0
    • None
    • None

    Description

      We encountered an error during a test in our QE when the file destination and source path were the same. This happened during an ADLS test, and there were no meaningful error messages, so it was hard to find the root cause of the failure.
      The error we saw was that file size has changed during the copy operation. The new file creation in the destination - which is the same as the source - creates a file and sets the file length to zero. After this, getting the source file will fail because the sile size changed during the operation.

      I propose a solution to at least log in error level in the FileUtil if the source and destination of the copy operation is the same, so debugging issues like this will be easier in the future.

      Update: This has been reverted as it caused problems. When rolling back from a branch

      Attachments

        1. hdfsTest.patch
          4 kB
          Ayush Saxena

        Issue Links

          Activity

            People

              gabor.bota Gabor Bota
              gabor.bota Gabor Bota
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 10m
                  2h 10m