Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72737

Method download returns before finishing complete download

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • artifactory-plugin
    • None

      The method download is not working synchronous in a scripted pipeline.

      A simple could like this turns out the method starts to download some files (but not all) and then then next message in the script is already executed:

      timestamps {
          node('compile') {
              deleteDir()
              stage ('Checkout SystemTools'){
                  Artefacts art = new Artefacts()
                  println("Before Downloading SystemTools")
                  art.download('AEP.Tools/system-tools/windows/*', '.\\SystemTools\\')
                  println("After Downloading SystemTools")
                  println("Before Downloading cyclondx")
                  art.download('AEP.Tools/cyclonedx-cli/cyclonedx-cli.exe', '.\\SystemTools\\')
              } 

      In the attached screenshot you can see that the message "After Downloading Systemtools" is printed out BEFORE the download is finished completely. 

      This behavior  can cause serious race conditions in the code. 

            eyalbe Eyal Ben Moshe
            saschaeggers Sascha Eggers
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: