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

multiple builds are triggered for one change in Gerrit

      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!

          [JENKINS-10709] multiple builds are triggered for one change in Gerrit

          Jesse Glick added a comment -

          So, fixed then.

          Jesse Glick added a comment - So, fixed then.

          Paul Jackson added a comment -

          I've fetched the latest source and tested locally. I can confirm it is fixed for us.

          Paul Jackson added a comment - I've fetched the latest source and tested locally. I can confirm it is fixed for us.

          Vlad Aginsky added a comment -

          Hi Hugo and all, I still observe this on version 1.535, ang gerrit trigger 2.10.1.
          What release was supposed to contain the solution?

          Vlad Aginsky added a comment - Hi Hugo and all, I still observe this on version 1.535, ang gerrit trigger 2.10.1. What release was supposed to contain the solution?

          Hugo Ares added a comment - - edited

          This is fixed in 2.11.0 which is not released yet. Robert just created version 2.11.0-beta-1[1] so I guess we can expect a release soon.

          [1]https://groups.google.com/forum/#!topic/jenkinsci-dev/K41zja0b5mo

          Hugo Ares added a comment - - edited This is fixed in 2.11.0 which is not released yet. Robert just created version 2.11.0-beta-1 [1] so I guess we can expect a release soon. [1] https://groups.google.com/forum/#!topic/jenkinsci-dev/K41zja0b5mo

          rsandell added a comment -

          Yepp, I just released 2.11.0-beta-1, it should be available in the experimental update center soon. And I am looking for brave beta testers to try it out

          rsandell added a comment - Yepp, I just released 2.11.0-beta-1, it should be available in the experimental update center soon. And I am looking for brave beta testers to try it out

          Curtis Kline added a comment -

          I would be willing to try it out on our test instance. Right now I am removing the Gerrit Trigger from all of the jobs we recently implemented it on due to this bug. Ah well, it was fun while it lasted! (Jenkins 1.509.4 and GT 2.10.1)

          Curtis Kline added a comment - I would be willing to try it out on our test instance. Right now I am removing the Gerrit Trigger from all of the jobs we recently implemented it on due to this bug. Ah well, it was fun while it lasted! (Jenkins 1.509.4 and GT 2.10.1)

          Vlad Aginsky added a comment -

          We still suffer from this. Is there any progress? I would like to be a beta tester if this can help.

          Vlad Aginsky added a comment - We still suffer from this. Is there any progress? I would like to be a beta tester if this can help.

          Hugo Ares added a comment -

          Vlad, have you tried the latest 2.11 beta(2.11.0-beta-4)?

          Hugo Ares added a comment - Vlad, have you tried the latest 2.11 beta(2.11.0-beta-4)?

          Curtis Kline added a comment -

          I am concerned about this bug being marked "fixed". I am running 2.11.1 of the trigger plugin, and I believe it still exhibits this behavior.

          Curtis Kline added a comment - I am concerned about this bug being marked "fixed". I am running 2.11.1 of the trigger plugin, and I believe it still exhibits this behavior.

          sakshi sood added a comment -

           I am using Jenkins 2.19.3 and gerrit trigger version 2.23.0  and I believe it still exhibits this behaviour

          sakshi sood added a comment -  I am using Jenkins 2.19.3 and gerrit trigger version 2.23.0  and I believe it still exhibits this behaviour

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

              Created:
              Updated:
              Resolved: