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

Attempts to restrict Pipeline jobs from running on master result in job hanging

      Trying the job-restrictions-plugin with Workflow jobs - I added a restriction to master that only jobs matching a regex could run on there. At first glance, that looked perfect - a Workflow job that didn't match that regex stayed in queue while another Workflow job that did match ran fine.

      But then I realized that the non-matching job was still sitting in queue, even after another executor not on the master was available. The job is just stuck - it's not even getting to the node { }, etc. If it can't run on master (when master has executors), it just flops around. Ow.

          [JENKINS-31866] Attempts to restrict Pipeline jobs from running on master result in job hanging

          Andrew Bayer created issue -
          Andrew Bayer made changes -
          Link New: This issue is related to INFRA-504 [ INFRA-504 ]

          Andrew Bayer added a comment -

          And cc danielbeck

          Andrew Bayer added a comment - And cc danielbeck
          Andrew Bayer made changes -
          Assignee New: Oleg Nenashev [ oleg_nenashev ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 167332 ] New: JNJira + In-Review [ 182686 ]
          Oleg Nenashev made changes -
          Link New: This issue is related to JENKINS-38644 [ JENKINS-38644 ]

          Oleg Nenashev added a comment -

          Well, Job Restrictions are still do not officially support Pipeline. I've made some progress in JENKINS-38644, which works around the blockage cause. There is also a patch for JENKINS-36626, which addresses some extra cases.

          The work still needs to be done.

          Oleg Nenashev added a comment - Well, Job Restrictions are still do not officially support Pipeline. I've made some progress in JENKINS-38644 , which works around the blockage cause. There is also a patch for JENKINS-36626 , which addresses some extra cases. The work still needs to be done.
          Oleg Nenashev made changes -
          Summary Original: Attempts to restrict Workflow jobs from running on master result in job hanging New: Attempts to restrict Pipeline jobs from running on master result in job hanging
          Oleg Nenashev made changes -
          Link New: This issue is related to JENKINS-36626 [ JENKINS-36626 ]

          Greg Smith added a comment -

          I recently ran into this problem too:

          It seems that the webhook that causes the build to be run – which then kicks off the scan of the repo – runs on master.

          So say you have a github org definition of "MyCompany" and all projects are under that, like "MyCompany/aproject/master"

          Now you set the restrictions so that "master will not run any builds under 'MyCompany'" with a regex like:
          ^(?!MyCompany\/)

          That successfully stops any of those builds from using a node("master") – but it also stops the incoming webhook from running a scan – so all builds in that github org "hang"

          This plugin needs some kind of special allowance for the scan, or maybe some way to define that scans are OK.

          Greg Smith added a comment - I recently ran into this problem too: It seems that the webhook that causes the build to be run – which then kicks off the scan of the repo – runs on master. So say you have a github org definition of "MyCompany" and all projects are under that, like "MyCompany/aproject/master" Now you set the restrictions so that "master will not run any builds under 'MyCompany'" with a regex like: ^(?!MyCompany\/) That successfully stops any of those builds from using a node("master") – but it also stops the incoming webhook from running a scan – so all builds in that github org "hang" This plugin needs some kind of special allowance for the scan, or maybe some way to define that scans are OK.

            Unassigned Unassigned
            abayer Andrew Bayer
            Votes:
            11 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated: