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

NullPointerException in AdvancedQueueSorter

    XMLWordPrintable

Details

    Description

      Hi,

      Our Jenkins server seems to get locked at some point in time.
      Many Jobs are in starvation, waiting for nodes with certain labels/label combinations.
      (i.e. Waiting for next available executor on ...)

      The log shows a lot of these entries:

      Apr 15, 2015 3:44:25 PM SEVERE hudson.triggers.SafeTimerTask run
      
      Timer task hudson.model.Queue$MaintainTask@5d00189f failed
      java.lang.NullPointerException
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter$2.compare(AdvancedQueueSorter.java:99)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter$2.compare(AdvancedQueueSorter.java:81)
      	at java.util.TimSort.countRunAndMakeAscending(TimSort.java:329)
      	at java.util.TimSort.sort(TimSort.java:189)
      	at java.util.TimSort.sort(TimSort.java:173)
      	at java.util.Arrays.sort(Arrays.java:659)
      	at java.util.Collections.sort(Collections.java:217)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter.sortBuildableItems(AdvancedQueueSorter.java:81)
      	at hudson.model.Queue.maintain(Queue.java:1135)
      	at hudson.model.Queue$MaintainTask.doRun(Queue.java:2197)
      	at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      
      Feed
      

      and also some entries like

      java.lang.NullPointerException
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorter.onLeft(AdvancedQueueSorter.java:157)
      	at jenkins.advancedqueue.sorter.AdvancedQueueSorterQueueListener.onLeft(AdvancedQueueSorterQueueListener.java:47)
      	at hudson.model.Queue$LeftItem.enter(Queue.java:2087)
      	at hudson.model.Queue.onStartExecuting(Queue.java:924)
      	at hudson.model.Executor.run(Executor.java:209)
      	at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)
      

      We see theses issues since we updated the Priority Sorter Plugin to version 2.11 (from version 2.9)

      Downgrading to version 2.9 seems to work fine!

      Attachments

        Activity

          Code changed in jenkins
          User: emsa23
          Path:
          src/main/java/jenkins/advancedqueue/sorter/AdvancedQueueSorter.java
          http://jenkins-ci.org/commit/priority-sorter-plugin/93f73c0cce8ccf5238415a8fb37cd9558d9bcf5e
          Log:
          JENKINS-27957 NullPointerException in AdvancedQueueSorter

          Some items do not have names so returning 0 seems to be the only
          option

          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/93f73c0cce8ccf5238415a8fb37cd9558d9bcf5e Log: JENKINS-27957 NullPointerException in AdvancedQueueSorter Some items do not have names so returning 0 seems to be the only option

          Fixed in 2.12

          emsa23 Magnus Sandberg added a comment - Fixed in 2.12
          mwebber Matthew Webber added a comment - - edited

          I upgraded Priority-Sorter to 3.0, and Jenkins from 1.611 to 1.612, and this problem re-appeared. Downgrading Priority-Sorter to 2.12 fixed the problem.

          mwebber Matthew Webber added a comment - - edited I upgraded Priority-Sorter to 3.0, and Jenkins from 1.611 to 1.612, and this problem re-appeared. Downgrading Priority-Sorter to 2.12 fixed the problem.
          danielbeck Daniel Beck added a comment -

          The 3.0 issue is tracked as JENKINS-28195.

          danielbeck Daniel Beck added a comment - The 3.0 issue is tracked as JENKINS-28195 .

          People

            emsa23 Magnus Sandberg
            tom_ghyselinck Tom Ghyselinck
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: