Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-41893

clang_format.py's caching mechanism should save tarballs that include the UID

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Build, Usability
    • Labels:
      None

      Description

      buildscripts/clang_format.py does this:

      def get_clang_format_from_cache_and_extract(url, tarball_ext):
          """Get clang-format from mongodb's cache and extract the tarball."""
          dest_dir = tempfile.gettempdir()
          temp_tar_file = os.path.join(dest_dir, "temp.tar" + tarball_ext)
       
          # Download from file
          print("Downloading clang-format %s from %s, saving to %s" % (CLANG_FORMAT_VERSION, url,
                                                                       temp_tar_file))
      

      It tries to download, and cache, the clang-format binary into /tmp/temp.tar.gz. Unfortunately, if two Linux accounts are trying to run clang_format.py, only one can successfully download the binary.

      To fix this, the cache path the script saves the tarball into should contain something unique to the account, likely the UID.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: