Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-14326

Static temporary file specification for the hg plugin causes builds to hang on checkouts

    XMLWordPrintable

Details

    Description

      Because the file specification which defines a temp location of the ssh key are static, this causes builds started simultaneously to hang as one build will clear the file after its run. This is specified as thus in the HgRepositoryAccessImpl.java file:

      public final static SecureTemporaryFiles.TemporaryFileSpec TEMPORARY_FILE_SPEC =
                  SecureTemporaryFiles.builder()
                          .setPrefix("bambooHg")
                          .setSuffix(".tmp")
                          .useShortDirectoryName()
                          .failWhenPermissionsNotSet()
                          .build();
      
          @NotNull
          File createTmpFileWithKey() throws IOException, InterruptedException
          {
              final File file = SecureTemporaryFiles.create(TEMPORARY_FILE_SPEC);
      
              FileUtils.writeStringToFile(file, substitutedAccessData.getSshKey());
              return file;
          }
      

      Attachments

        Issue Links

          Activity

            People

              pbruski Przemek Bruski
              smaiyaki Sultan Maiyaki (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: