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

Pipeline scripts that appear as "queued" in classic UI are not returned from /queue API

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Trivial Trivial
    • blueocean-plugin
    • None
    • atlantic

      From cliffmeyers:

      Hitting the /queue REST API for a Pipeline always returns an empty array, since under the hood a Pipeline is run immediately even when the normal (2) executors are busy. I believe this affects multi-branch pipelines as well. Freestyle jobs behave normally with items showing up in /queue.

      The Pipeline stage graph in classic UI seems to work around by fetching the runs via the REST API and checking for jobs with an empty "steps" array and treating them as "QUEUED."

      From vivek:

      For issue#1: that is /pipelines/p1/queue/ returning empty array:

      If I run a pipeline (with sleep of 1 hour) and click build like 20 times, I have bunch of items in the queue appearing in classic UI.

      node {
      stage 'Stage 1'
      sh 'sleep 3600'
      }

      Classic UI shows these pipeline jobs in queue so there is no underlying issues as far as I can see it working.

      Ivan,

      bug is in QueueContainerImpl.getQueuedItems(),

      Jenkins.getInstance().getQueue().getItems(task)

      Queue.getItems() gives list of queued items only for certain tasks, in case of pipeline its none of them so it fails.

      What needs to happen is to get all the queued items and filter them for given job. sort of how I implemented in MultiBranchPipelineQueueContainer.java. but there you refactored to use QueueContainerImpl.getQueuedItems() so that stopped working for queued items for multi branch projects as well.

      You can also look at: hudson.model.View.getQueuedItems() as well.

            vivek Vivek Pandey
            cliffmeyers Cliff Meyers
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: