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

StandardDirectoryFactory::move never uses atomic implementation

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          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:

              Slack

                Issue deployment