Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-5612

Undesired interaction between RecreateMavenMetadataWalkerProcessor and DefaultFSPeer

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: None
    • Labels:
      None

      Description

      DefaultFSPeer#listItems returns empty list of files for empty directories, directories that do not exist, files that are not directories and in case of IO exception.

      RecreateMavenMetadataWalkerProcessor#onCollectionExit uses output of DefaultFSPeer#listItems (through StorageCollectionItem.list().size() call) to determine if directory is empty and should be deleted.

      When system running Nexus is in "bad" state, due to running out of file handles for example, DefaultFSPeer#listItems is not able to list directories reliably and returns empty collection to the caller. In case of RecreateMavenMetadataWalkerProcessor, empty directory list triggers attempt to delete the directory, which may succeed.

      Need to change DefaultFSPeer#listItems definition (and likely FSPeer#listItems API) to throw LocalStorageException if directory cannot be listed, i.e. File#listFiles returns null. Need to review all clients of FSPeer#listItems API to make sure they properly handle LocalStorageException.

      As a side note, it is not clear why rebuild maven metadata tasks deletes anything.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ifedorenko Igor Fedorenko
            Last Updated By:
            Peter Lynch Peter Lynch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title