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

Concurrent Pipeline builds report all changes since last completed build

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      Jenkins ver. 2.164.3
      p4-plugin 1.9.6
    • Similar Issues:

      Description

      When running two concurrent pipeline builds, the second one will contain the changes from the first (so long as the first hasn't finished running when the second pipeline starts).

       

      CL 1 starts a build

      CL 2 starts a build

       

      Then Build #2 will contain CL 1 and CL 2 even though it is really only "newly" building CL 2.

       

      This causes issues for reporting (e-mails, jenkins ui, ect) since it makes it look like CL 1 was first introduced in Build #2 when it was really introduced in Build #1.

        Attachments

          Activity

          Hide
          p4karl Karl Wirth added a comment -

          Hi William Brode - Thanks for highlighting this.

          To help me test this, do the concurrent jobs have unique workspace names?For example are you including 'EXECUTOR_NUMBER' in the workspace name and can you see in the job output that a different workspace is used in each? Also are both jobs running on the same slave node or in a unique node (such as a docker container)?

          Show
          p4karl Karl Wirth added a comment - Hi William Brode - Thanks for highlighting this. To help me test this, do the concurrent jobs have unique workspace names?For example are you including 'EXECUTOR_NUMBER' in the workspace name and can you see in the job output that a different workspace is used in each? Also are both jobs running on the same slave node or in a unique node (such as a docker container)?
          Hide
          p4karl Karl Wirth added a comment -

          Hi William Brode, I have tested this here on P4-Plugin1.10.0 and can see that my workspace contains the correct files for each job but the reporting shows both changes-lists. For example:

          First job...

          Second job...

          I'm assuming this is the behavior you saw. If not please let me know.

           

          Reproduction Steps:

          1 - Create a Jenkinsfile containing a 60 second sleep:

          pipeline {
            agent { label 'master' }
            stages {
              stage("Repro") {
                steps {
                  script {
                     echo "Starting job."           
          
                     echo "This shows that the slave contains the correct files with an implicit sync."
                     sh 'ls -l'           echo "Sleep for 60 seconds to allow overlap"
          	   sleep 60
                  }
                }
              }
            }
          }
          

          2 - Add Jenkinsfile and test.txt file to the depot

          3 - Create a pipeline job that uses the jenkinsfile.

          4 - Run build once to create baseline.

          5 - Edit and submit test.txt

          6 - Run build.

          7 - Wait 10 seconds then quickly edit and submit test.txt. For example:

          p4 edit test.txt && echo test >> test.txtx && p4 submit -d "Edited test.txt"
          

          8 - Manually run build again (must be within 40 seconds of the build started in step 6).

          Outcome :

          Build 2 will report changelist 2.

          Build 3 will report changelist 2 and 3.

          Expected:

          Build 2 will report changelist 2.

          Build 3 will report changelist 3.

          Note - This is not the same as poll per change. If two edits had been made Build 3 should report changelists 3 and 4.

           

           

           

          Show
          p4karl Karl Wirth added a comment - Hi William Brode , I have tested this here on P4-Plugin1.10.0 and can see that my workspace contains the correct files for each job but the reporting shows both changes-lists. For example: First job... Second job... I'm assuming this is the behavior you saw. If not please let me know.   Reproduction Steps: 1 - Create a Jenkinsfile containing a 60 second sleep: pipeline { agent { label 'master' } stages { stage( "Repro" ) { steps { script { echo "Starting job." echo "This shows that the slave contains the correct files with an implicit sync." sh 'ls -l' echo "Sleep for 60 seconds to allow overlap" sleep 60 } } } } } 2 - Add Jenkinsfile and test.txt file to the depot 3 - Create a pipeline job that uses the jenkinsfile. 4 - Run build once to create baseline. 5 - Edit and submit test.txt 6 - Run build. 7 - Wait 10 seconds then quickly edit and submit test.txt. For example: p4 edit test.txt && echo test >> test.txtx && p4 submit -d "Edited test.txt" 8 - Manually run build again (must be within 40 seconds of the build started in step 6). Outcome : Build 2 will report changelist 2. Build 3 will report changelist 2 and 3. Expected: Build 2 will report changelist 2. Build 3 will report changelist 3. Note - This is not the same as poll per change. If two edits had been made Build 3 should report changelists 3 and 4.      
          Hide
          p4kevin Kevin Williamson added a comment -

          Limitation documented.

          Show
          p4kevin Kevin Williamson added a comment - Limitation documented.

            People

            • Assignee:
              p4kevin Kevin Williamson
              Reporter:
              wbrode William Brode
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: