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

Queue broken by CCE from PriorityConfiguration.getPriorityInternal

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      A user of cloudbees-folders-plus (from Jenkins Enterprise) reports that moving a job from folder to Jenkins root is broken with

      java.lang.ClassCastException: com.cloudbees.hudson.plugins.folder.relocate.RelocateTask cannot be cast to hudson.model.Job
      	at jenkins.advancedqueue.PriorityConfiguration.getPriorityInternal(PriorityConfiguration.java:207)
      	at jenkins.advancedqueue.PriorityConfiguration.getPriority(PriorityConfiguration.java:199)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter.onNewItem(AdvancedQueueSorter.java:111)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter.getCalculatedWeight(AdvancedQueueSorter.java:103)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter.access$000(AdvancedQueueSorter.java:47)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter$2.compare(AdvancedQueueSorter.java:78)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter$2.compare(AdvancedQueueSorter.java:76)
      	at java.util.TimSort.countRunAndMakeAscending(Unknown Source)
      	at java.util.TimSort.sort(Unknown Source)
      	at java.util.TimSort.sort(Unknown Source)
      	at java.util.Arrays.sort(Unknown Source)
      	at java.util.Collections.sort(Unknown Source)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter.sortBuildableItems(AdvancedQueueSorter.java:76)
      	at hudson.model.Queue.maintain(Queue.java:1092)
      	at hudson.model.Queue$MaintainTask.doRun(Queue.java:2084)
      	at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54)
      	at java.util.TimerThread.mainLoop(Unknown Source)
      	at java.util.TimerThread.run(Unknown Source)
      

      Probably other special queue tasks would also be broken by this plugin, which assumes without checking that every Task is a Job.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/jenkins/advancedqueue/PriorityConfiguration.java
            http://jenkins-ci.org/commit/priority-sorter-plugin/5fbd7d9c3b6785b8e0cc78cb72bcca42a68e5bb4
            Log:
            [FIXED JENKINS-21310] CCE when a Queue.Task was not a Job.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/jenkins/advancedqueue/PriorityConfiguration.java http://jenkins-ci.org/commit/priority-sorter-plugin/5fbd7d9c3b6785b8e0cc78cb72bcca42a68e5bb4 Log: [FIXED JENKINS-21310] CCE when a Queue.Task was not a Job.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: emsa23
            Path:
            src/main/java/jenkins/advancedqueue/PriorityConfiguration.java
            http://jenkins-ci.org/commit/priority-sorter-plugin/9c3fc0039aac147a8d2cc22582f116385acbcf98
            Log:
            Merge pull request #14 from jglick/CCE-JENKINS-21310

            [FIXED JENKINS-21310] CCE when a Queue.Task was not a Job

            Compare: https://github.com/jenkinsci/priority-sorter-plugin/compare/1e1336a423d2...9c3fc0039aac

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: emsa23 Path: src/main/java/jenkins/advancedqueue/PriorityConfiguration.java http://jenkins-ci.org/commit/priority-sorter-plugin/9c3fc0039aac147a8d2cc22582f116385acbcf98 Log: Merge pull request #14 from jglick/CCE- JENKINS-21310 [FIXED JENKINS-21310] CCE when a Queue.Task was not a Job Compare: https://github.com/jenkinsci/priority-sorter-plugin/compare/1e1336a423d2...9c3fc0039aac
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: emsa23
            Path:
            src/main/java/jenkins/advancedqueue/PriorityConfiguration.java
            src/main/java/jenkins/advancedqueue/priority/PriorityStrategy.java
            http://jenkins-ci.org/commit/priority-sorter-plugin/5b6e7c68d3cde206608e7bfc4f5b975470af64f7
            Log:
            JENKINS-21316 PrioritySorter wrongly assumes Queue.Task is Job

            • Updated fix provided for JENKINS-21310 to exit early
            • Updated javadoc to clearify responsibilities
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: emsa23 Path: src/main/java/jenkins/advancedqueue/PriorityConfiguration.java src/main/java/jenkins/advancedqueue/priority/PriorityStrategy.java http://jenkins-ci.org/commit/priority-sorter-plugin/5b6e7c68d3cde206608e7bfc4f5b975470af64f7 Log: JENKINS-21316 PrioritySorter wrongly assumes Queue.Task is Job Updated fix provided for JENKINS-21310 to exit early Updated javadoc to clearify responsibilities

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: