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

Jenkins not scheduling any jobs after upgrade to Priority Sorter 3.0 but giving exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: prioritysorter-plugin
    • Labels:
      None
    • Environment:
      Priority Sorter 3.0, CloudBees Folder 4.7
      Jenkins 1.612
      running under Tomcat 8 on JDK 1.8.45 64Bit, Windows Server 2008
    • Similar Issues:

      Description

      After upgrade to Priority Sorter 3.0 and defining the new Priority Groups Jenkins doesn't schedule any more jobs but just throws NPE:

      May 04, 2015 8:08:10 AM SEVERE hudson.triggers.SafeTimerTask run
      
      Timer task hudson.model.Queue$MaintainTask@eccba45 failed
      java.lang.NullPointerException
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter$2.compare(AdvancedQueueSorter.java:80)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter$2.compare(AdvancedQueueSorter.java:76)
      	at java.util.TimSort.countRunAndMakeAscending(TimSort.java:351)
      	at java.util.TimSort.sort(TimSort.java:216)
      	at java.util.Arrays.sort(Arrays.java:1512)
      	at java.util.ArrayList.sort(ArrayList.java:1454)
      	at java.util.Collections.sort(Collections.java:175)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter.sortBuildableItems(AdvancedQueueSorter.java:76)
      	at hudson.model.Queue.maintain(Queue.java:1342)
      	at hudson.model.Queue$MaintainTask.doRun(Queue.java:2457)
      	at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

      Priority Sorter Log itself looks very much normal and priorities seem to be assigned as expected. There are no exceptions in that log:

      [...]
      New Item: Id: 20542, JobName: XXX-Sync-Rsync-Repository with ..., jobGroupId: 2, reason: <none>, priority: 1, weight: 1.0, status: WAITING
        Evaluating JobGroup [0] ...
        Evaluating JobGroup [1] ...
        Evaluating JobGroup [2] ...
            Evaluating strategies ...
              Evaluating strategy [Job Triggered by a Upstream Build] ...
              Evaluating strategy [Take the priority from Property on the Job] ...
            No applicable strategy - Using JobGroup default
      
      May 04, 2015 8:07:02 AM FINE jenkins.advancedqueue.ItemTransitionLogger logBuilableItem
      
      Buildable: Id: 20542, JobName: ***-Sync-Rsync-Repository with ***, jobGroupId: 2, reason: <none>, priority: 1, weight: 1.0, status: BUILDABLE
      
      May 04, 2015 8:11:02 AM FINER PrioritySorter.Queue.Items
      
      New Item: Id: 20543, JobName: ADMIN_***_Install_RTS_***-slave8, jobGroupId: 6, reason: <none>, priority: 3, weight: 3.0, status: WAITING
        Evaluating JobGroup [0] ...
        Evaluating JobGroup [1] ...
        Evaluating JobGroup [2] ...
        Evaluating JobGroup [3] ...
        Evaluating JobGroup [4] ...
        Evaluating JobGroup [5] ...
            Checking for Job Property inclusion for [*** Unit Tests]...
            Checking for Cloudbees Folder inclusion ...
              Evaluating Folder [ADMIN_***_Install_RTS] ...
            No match ...
        Evaluating JobGroup [6] ...
            Evaluating strategies ...
              Evaluating strategy [Job Triggered by a Upstream Build] ...
              Evaluating strategy [Take the priority from Property on the Job] ...
            No applicable strategy - Using JobGroup default
      [...]
      

      Downgrade to Priority Sorter 2.12 removes the problem.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: emsa23
          Path:
          src/main/java/jenkins/advancedqueue/sorter/AdvancedQueueSorter.java
          http://jenkins-ci.org/commit/priority-sorter-plugin/b6bf3e4325a801146b40d959045b0f6f2652a96c
          Log:
          Gracefully fallback to queue-time sorting if items are unknown

          JENKINS-28195

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: emsa23 Path: src/main/java/jenkins/advancedqueue/sorter/AdvancedQueueSorter.java http://jenkins-ci.org/commit/priority-sorter-plugin/b6bf3e4325a801146b40d959045b0f6f2652a96c Log: Gracefully fallback to queue-time sorting if items are unknown JENKINS-28195
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: emsa23
          Path:
          src/main/java/jenkins/advancedqueue/sorter/AdvancedQueueSorterQueueListener.java
          http://jenkins-ci.org/commit/priority-sorter-plugin/cbf68049874f3efc8e71361bb49cf34e8091de43
          Log:
          Gracefully handle out-of-sync lifecycle events

          JENKINS-28195

          Compare: https://github.com/jenkinsci/priority-sorter-plugin/compare/cc14f2ee194b...cbf68049874f

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: emsa23 Path: src/main/java/jenkins/advancedqueue/sorter/AdvancedQueueSorterQueueListener.java http://jenkins-ci.org/commit/priority-sorter-plugin/cbf68049874f3efc8e71361bb49cf34e8091de43 Log: Gracefully handle out-of-sync lifecycle events JENKINS-28195 Compare: https://github.com/jenkinsci/priority-sorter-plugin/compare/cc14f2ee194b...cbf68049874f
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          src/main/java/jenkins/advancedqueue/PrioritySorterPlugin.java
          http://jenkins-ci.org/commit/priority-sorter-plugin/12f7073dafd94301b0fe4e7ec987adbda30cdab2
          Log:
          JENKINS-28195 fixup cbf6804

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/jenkins/advancedqueue/PrioritySorterPlugin.java http://jenkins-ci.org/commit/priority-sorter-plugin/12f7073dafd94301b0fe4e7ec987adbda30cdab2 Log: JENKINS-28195 fixup cbf6804
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: emsa23
          Path:
          src/main/java/jenkins/advancedqueue/PrioritySorterPlugin.java
          http://jenkins-ci.org/commit/priority-sorter-plugin/c9cca9f92835e9ec52089285743f8077092323b0
          Log:
          Merge pull request #26 from olivergondza/fix-startup

          JENKINS-28195 fixup cbf6804

          Compare: https://github.com/jenkinsci/priority-sorter-plugin/compare/6592055dee93...c9cca9f92835

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: emsa23 Path: src/main/java/jenkins/advancedqueue/PrioritySorterPlugin.java http://jenkins-ci.org/commit/priority-sorter-plugin/c9cca9f92835e9ec52089285743f8077092323b0 Log: Merge pull request #26 from olivergondza/fix-startup JENKINS-28195 fixup cbf6804 Compare: https://github.com/jenkinsci/priority-sorter-plugin/compare/6592055dee93...c9cca9f92835
          Hide
          emsa23 Magnus Sandberg added a comment -

          Fixed in 3.1

          Show
          emsa23 Magnus Sandberg added a comment - Fixed in 3.1

            People

            • Assignee:
              emsa23 Magnus Sandberg
              Reporter:
              klou Kurt
            • Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: