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

RequesterRecipientProvider.java hangs when a build is upstream of itself

    • 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;
      }

          [JENKINS-46548] RequesterRecipientProvider.java hangs when a build is upstream of itself

          pixman20 created issue -
          pixman20 made changes -
          Issue Type Original: Improvement [ 4 ] New: Bug [ 1 ]
          Alex Earl made changes -
          Assignee Original: David van Laatum [ davidvanlaatum ] New: Alex Earl [ slide_o_mix ]
          Alex Earl made changes -
          Assignee Original: Alex Earl [ slide_o_mix ]

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

              Created:
              Updated: