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

Race condition during maven-metadata.xml deployment can cause invalid blob references and 500 response for subsequent GET requests

    Details

    • Story Points:
      13
    • Sprint:
      NXRM Immortals Sprint 30, NXRM Immortals Sprint 31, NXRM Immortals Sprint 32, NXRM Immortals Sprint 33, NXRM Immortals Sprint 34, NXRM Immortals Sprint 35, NXRM Immortals Sprint 36
    • Notability:
      2
    • InvestmentLayer:
      customer-driven
    • Aha Concept:
      non-concept

      Description

      A race condition exists when two threads simultaneously make updates to a GA level maven-metadata.xml file.

      The is is the scenario:

      1. A GET request triggers a GA level maven-metadata.xml rebuild due to an earlier deployment, and the GA level file is deleted and recreated.
      2. Later, a new GET request for the new GA level maven-metadata.xml file comes in.
      3. At the same time, a PUT request for the GA level maven-metadata.xml file occurs.

      The second GET request triggers an update for the last download time.
      The PUT request triggers an update for the maven-metadata.xml file.

      This causes a race condition, and sometimes the wrong thread wins. When this occurs, the next GET request for the GA level maven-metadata.xml file will fail with a 500 response. The logs show that the blob referenced by the database is in soft deleted state.

      Workaround

      Repeating the failed build and or GET request in a way that avoids the race condition.

      Expected

      Implement a change that prevents a GET request for the GA level maven-metadata.xml file failing with a 500 response code for the reproduce scenario.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Michael Prescott Michael Prescott
              Team:
              NXRM - Optimus
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title