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


    • 13
    • 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
    • 2
    • customer-driven
    • non-concept
    • 2


      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.


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


      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.



        Issue Links



              Unassigned Unassigned
              rseddon Rich Seddon
              Michael Oliverio Michael Oliverio
              NXRM - Optimus
              1 Vote for this issue
              12 Start watching this issue