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

npm package metadata conditional gets from NXRM to another NXRM always receive a response of 200 instead of 304 when content has not changed

    XMLWordPrintable

    Details

    • Notability:
      2

      Description

      Problem

      NXRM proxy repo to NXRM group repo npm package metadata requests send an If-Modified-Since, but no If-None-Match header for npm package metadata. However the responding NXRM always will respond with 200 instead of 304, even though there were no changes to the npm package metadata.

      When the requesting proxy repo receives the 200 response, and that proxy repo is also in a group repository, both the proxy repo and group repo npm package metadata is replaced - even though the content is exactly the same as what is already cached.

      Over time this fills the NXRM proxy repo and group repo blobstore with soft-deleted npm package metadata bytes and properties files which are the replaced package metadata.

      If the metadata max age is set to a low value on the proxy repo and incoming requests are high, this can quickly fill the blobstore with soft-deleted files which require more frequent than usual running of the Compact blob store task to remove these files.

      It was noticed that if NXRM ( 3.17.0 and newer required due to NEXUS-19941 ) proxies the official NPM registry, then outbound package metadata requests will send both an If-None-Match and If-Modified-Since header. Consequently in that case, the remote returns a 304 if the package metadata is not changed and the blob files are not replaced.

      The following combinations have been confirmed to exhibit this problem ( others may as well):

      NXRM 3.17.0 -> NXRM 3.9.0
      NXRM 3.17.0 -> NXRM 3.17.0
      NXRM 3.19.0 -> NXRM 3.19.0
      NXRM 3.17.0 -> NXRM 2.14.15

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mdodgson Mark Dodgson
              Reporter:
              plynch Peter Lynch
              Last Updated By:
              Wes Wannemacher Wes Wannemacher
              Team:
              NXRM - Operations/Groot
              Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title