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

Parameterized Trigger hangs waiting for downstream job

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 2.73.2, Parameterized Trigger Plugin 2.35.1, Promoted Builds 2.29.1

      We use Parameterized Trigger to launch downstream jobs from a Promoted Builds promotion. The problem is that if the downstream job queues then the Promotion job hangs waiting for it. The stack trace is:

      java.lang.Object.wait(Native Method)
      java.lang.Object.wait(Object.java:502)
      hudson.remoting.AsyncFutureImpl.get(AsyncFutureImpl.java:73)
      hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:111)
      hudson.plugins.promoted_builds.Promotion$RunnerImpl.build(Promotion.java:425)
      hudson.plugins.promoted_builds.Promotion$RunnerImpl.doRun(Promotion.java:367)
      hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
      hudson.model.Run.execute(Run.java:1737)
      hudson.model.Run.run(Run.java:1694)
      hudson.plugins.promoted_builds.Promotion.run(Promotion.java:290)
      hudson.model.ResourceController.execute(ResourceController.java:97)
      hudson.model.Executor.run(Executor.java:421)
      

      I think it relates to this line in BuildTrigger.java.

      abstractBuild = (AbstractBuild) future.get();
      

      It was added in https://github.com/jenkinsci/parameterized-trigger-plugin/commit/a6de43746b11ae2113405f56203066af42abb124#diff-124e73168bc42ab0df38c0656f9aec8b

      We have downgraded the Parameterized Trigger plugin to 2.32 (prior to the above commit) resolves the issue, but there are security warnings for the older version so we'd like to be able to upgrade again.


      To replicate, use Promoted Builds to trigger a long running downstream job. After the first or second promotion you should see the promotion job hang waiting on the downstream job.

       

          [JENKINS-47442] Parameterized Trigger hangs waiting for downstream job

          G D added a comment - - edited

          Can confirm we running v2.35.2 and are experiencing the same problem.

          G D added a comment - - edited Can confirm we running  v2.35.2 and are experiencing the same problem.

          Travis Neal added a comment -

          Was this ever fixed for you guys? we're running into the same issues. We tried downgrading to 2.32 but this is lower than required for the Git plugin (which requires 2.33, which is the breaking version) downgrading the Git plugin to allow the parameterized trigger plugin to work correctly would mean removing core functionality from our Jenkins implementation.

          Travis Neal added a comment - Was this ever fixed for you guys? we're running into the same issues. We tried downgrading to 2.32 but this is lower than required for the Git plugin (which requires 2.33, which is the breaking version) downgrading the Git plugin to allow the parameterized trigger plugin to work correctly would mean removing core functionality from our Jenkins implementation.

          Mark Hermon added a comment -

          We were never able to get it working, we've since switched to kicking off the build from our normal jobs instead of from the Promoted Builds plugin.

          Mark Hermon added a comment - We were never able to get it working, we've since switched to kicking off the build from our normal jobs instead of from the Promoted Builds plugin.

          Reiner Wirtz added a comment -

           We transformed most of our jenkins jobs to jenkins pipeline.

          We never got a problem starting another jenkins job from piepeline.

           

          Reiner Wirtz added a comment -  We transformed most of our jenkins jobs to jenkins pipeline. We never got a problem starting another jenkins job from piepeline.  

          If someone is still reading this, here is the workaround I found:

           

          I made an ugly patch, just return always false in the canDeclare() method

           

          diff --git a/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java b/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java
          index 746d209..5232a99 100644
          --- a/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java
          +++ b/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java
          @@ -196,7 +196,8 @@ public class TriggerBuilder extends Builder implements DependencyDeclarer {
          private boolean canDeclare(AbstractProject owner) {
           // See HUDSON-5679 -- dependency graph is also not used when triggered from a promotion
          - return !owner.getClass().getName().equals("hudson.plugins.promoted_builds.PromotionProcess");
          + //return !owner.getClass().getName().equals("hudson.plugins.promoted_builds.PromotionProcess");
          + return false;
           }
          @Override
          

           

          The problem arised with dependency management, which is  clearly broken. The "patch" just bypasses the dependency management in all cases, no just the promotion.

           

          Even with the patch, when you look the build cause of the triggered job it is broken.

           

          Olivier Schiavo added a comment - If someone is still reading this, here is the workaround I found:   I made an ugly patch, just return always false in the canDeclare() method   diff --git a/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java b/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java index 746d209..5232a99 100644 --- a/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java +++ b/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java @@ -196,7 +196,8 @@ public class TriggerBuilder extends Builder implements DependencyDeclarer { private boolean canDeclare(AbstractProject owner) { // See HUDSON-5679 -- dependency graph is also not used when triggered from a promotion - return !owner.getClass().getName().equals( "hudson.plugins.promoted_builds.PromotionProcess" ); + // return !owner.getClass().getName().equals( "hudson.plugins.promoted_builds.PromotionProcess" ); + return false ; } @Override   The problem arised with dependency management, which is  clearly broken. The "patch" just bypasses the dependency management in all cases, no just the promotion.   Even with the patch, when you look the build cause of the triggered job it is broken.  

            huybrechts huybrechts
            mark_h Mark Hermon
            Votes:
            4 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: