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

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

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            sag47 Sam Gleske added a comment -

            aszostak I get that warning too. The primary reason for the error is the class loader for plugins is only populated with related plugins in which it depends. Since the job-restrictions plugin does not directly depend on pipeline plugins, the class loader for it does not include the workflow set of classes. You're right that you can ignore the error and it will "just work". Can probably be considered a bug. It should probably be using the uber classloader which exists in the plugin manager.

            sag47 Sam Gleske added a comment - aszostak I get that warning too. The primary reason for the error is the class loader for plugins is only populated with related plugins in which it depends. Since the job-restrictions plugin does not directly depend on pipeline plugins, the class loader for it does not include the workflow set of classes. You're right that you can ignore the error and it will "just work". Can probably be considered a bug. It should probably be using the uber classloader which exists in the plugin manager.
            sag47 Sam Gleske added a comment -

            aszostak I opened a PR addressing the warning you experienced https://github.com/jenkinsci/job-restrictions-plugin/pull/23

            sag47 Sam Gleske added a comment - aszostak I opened a PR addressing the warning you experienced https://github.com/jenkinsci/job-restrictions-plugin/pull/23
            aszostak Artur Szostak added a comment -

            Thank you for the warning fix. Looking forward to seeing the warning disappear in some future upgrade of our Jenkins instance.

            aszostak Artur Szostak added a comment - Thank you for the warning fix. Looking forward to seeing the warning disappear in some future upgrade of our Jenkins instance.
            ace Adrian Vlad added a comment -

            I have a similar problem. I have a pipeline called "test_pipeline" and inside it does:

            node('some_node') {
            ...
            }

            On "some_node" I use Restrict jobs execution at node -> Regular Expression (Job Name) with value test_pipeline.

            This configuration doesn't work (the build hangs). But if I change the value to test_pipeline.* then it works.

            What is the problem? Is job-restrictions using different pipeline names with some suffix? (test_pipeline/.* also works)

            ace Adrian Vlad added a comment - I have a similar problem. I have a pipeline called "test_pipeline" and inside it does: node( 'some_node' ) { ... } On "some_node" I use  Restrict jobs execution at node ->  Regular Expression (Job Name) with value  test_pipeline . This configuration doesn't work (the build hangs). But if I change the value to  test_pipeline.* then it works. What is the problem? Is  job-restrictions using different pipeline names with some suffix? ( test_pipeline/.* also works)
            oleg_nenashev Oleg Nenashev added a comment -

            As stated in https://groups.google.com/d/msg/jenkinsci-dev/uc6NsMoCFQI/AIO4WG1UCwAJ , I have no bandwidth to work on this issue anytime soon. I have marked the plugin for adoption. But I will be happy to review/release anything related to this issue while there is no other maintainer.

             

            oleg_nenashev Oleg Nenashev added a comment - As stated in https://groups.google.com/d/msg/jenkinsci-dev/uc6NsMoCFQI/AIO4WG1UCwAJ , I have no bandwidth to work on this issue anytime soon. I have marked the plugin for adoption. But I will be happy to review/release anything related to this issue while there is no other maintainer.  

            People

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

              Dates

                Created:
                Updated: