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

multiple builds are triggered for one change in Gerrit

XMLWordPrintable

      With Gerrit Trigger 2.3.0 we observe that sometimes there are multiple builds triggered for one change in Gerrit.

      Lets say in Jenkins build #25 is triggered by the Gerrit Trigger Plugin. Then we see for this build job the following message in Jenkins:
      Triggered by Gerrit: http://gerrit:8080/27060
      Other triggered builds for this event.
      myjob #25

      The strange thing is that the build job #25 says that there is another build job for the same event which actually itself (again build job #25).

      On the change in Gerrit we then get the following comments:
      1. Build Started http://jenkins:8080/jenkins/job/myjob/25/ (1/2)
      2. Build Started http://jenkins:8080/jenkins/job/myjob/25/ (2/2)
      3. Build Failed
      http://jenkins:8080/jenkins/job/myjob/25/ : FAILURE
      http://jenkins:8080/jenkins/job/myjob/25/ : FAILURE

      In Jenkins it looks like the build job is indeed triggered twice. At least we saw the build job #25 two times in the list of current builds. Normally our tests are failing if they are executed two times in parallel since they need exclusive access to certain resources.

      For the failed build job I have then the possibility to retirgger it by clicking on 'Retrigger' or 'Retrigger All'.
      'Retrigger' starts another build #26, but for the voting still the result of build #25 is taken into account:
      1. Build Started http://jenkins:8080/jenkins/job/myjob/26/ (2/2)
      2. Build Failed
      http://jenkins:8080/jenkins/job/myjob/25/ : FAILURE
      http://jenkins:8080/jenkins/job/myjob/26/ : SUCCESS

      Why does the Gerrit Trigger start multiple builds for only one change in Gerrit? Is this some feature? Can we configure the Gerrit Trigger plugin to always only start a single build?

      Any help would be appreciated. Thanks!

            rsandell rsandell
            edwin_kempin Edwin Kempin
            Votes:
            23 Vote for this issue
            Watchers:
            37 Start watching this issue

              Created:
              Updated:
              Resolved: