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

Too small "Head change query limit" causes perpetual job execution - Multibranch pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • P4-Plugin 1.11.0
      Jenkins 2.235.1
      P4D 2020.1

      If the last change on current branch is lower than HEAD CL - 'Head Change Query Limit' then any change to any branch under the parent path will trigger a build in current branch.

       

      Reproduction steps:

       

      (1) Create two Helix branches with Jenkinsfiles:

      //depot/multibranch/main/Jenkinsfile.

      //depot/multibranch/main/f1

      //depot/multibranch/dev1/Jenkinsfile.

      //depot/multibranch/dev1/f1

       

      (2) Create a Jenkins multibranch project with "include Branches" set to:

      //depot/multibranch/...

       

      (3) Scan the multibranch pipeline

       

      (4) Two jobs will build. One for each branch.

       

      (5) Add 2000 new revisions of dev/f1.  Below is a helper script to create N revisions of file X:

      if [ ! -n "$1" ]
      then
        echo "Build X  revisions of the given filename."
        echo "Usage: buildfile.sh <Num> <Filename> "
        exit -1
      fi  MYFILE=$2
      MYNUM=$1
      echo Created `date` ... > $MYFILE
      p4 add $MYFILE
      p4 change -o |
             sed "s/<enter description here>/Automated Submit/" |
             p4 submit -i
      for ((i=1;i<$MYNUM;i+=1)); do 
        echo $i; 
        p4 edit $MYFILE
        echo This is some automatically inserted text - Line $i >> $MYFILE
        p4 change -o |
             sed "s/<enter description here>/Automated Submit/" |
             p4 submit -i
      done
      

      (6) Scan multibranch pipeline.

      Result - dev1 and main builds

      Expected Result - dev1 builds.

       

      (7) Make another edit to dev/f1.

      Result - dev1 and main builds

      Expected Result - dev1 builds.

       

      Workaround:

      Increase "Head change query limit" to 10000 (ensures the last changelist on main is picked up by p4 changes -m1" then allow the main build to run once to update the SyncID correctly.

       

            Unassigned Unassigned
            p4karl Karl Wirth
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: