Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9937

StandardDirectoryFactory::move never uses atomic implementation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

            Path path1 = ((FSDirectory) baseFromDir).getDirectory().toAbsolutePath();
            Path path2 = ((FSDirectory) baseFromDir).getDirectory().toAbsolutePath();
            
            try {
              Files.move(path1.resolve(fileName), path2.resolve(fileName), StandardCopyOption.ATOMIC_MOVE);
            } catch (AtomicMoveNotSupportedException e) {
              Files.move(path1.resolve(fileName), path2.resolve(fileName));
            }
      

      Because path1 == path2 this code never does anything and move always defaults to the less efficient implementation in DirectoryFactory.

      Attachments

        1. SOLR-9937.patch
          1 kB
          Mike Drob

        Issue Links

          Activity

            People

              markrmiller@gmail.com Mark Miller
              mdrob Mike Drob
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: