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

RequesterRecipientProvider.java hangs when a build is upstream of itself

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • email-ext-plugin
    • None
    • Windows
      Email Extension Plugin v2.58

      When using the RequesterRecipientProvider class, it can get stuck in an infinite loop if a build ends up being upstream of itself.  The root cause looks to be in the plugin that provides "Rebuild" as an option, but nonetheless this code should handle the case where the build's upstream build is itself to prevent an infinite loop.

      https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/java/hudson/plugins/emailext/plugins/recipients/RequesterRecipientProvider.java#L55 

      cur = p.getBuildByNumber(upc.getUpstreamBuild());

      could be changed to the following to prevent an infinite loop

      Run<?, ?> upstreamBuild = p.getBuildByNumber(upc.getUpstreamBuild());
      if(cur == upstreamBuild) {
          context.getListener().getLogger().print("Somehow build " + cur + " is upstream of itself");
          break;
      }

            Unassigned Unassigned
            pixman20 pixman20
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: