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

owner may not be set and NPE fly!!

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • batch-task-plugin
    • None
    • Platform: All, OS: Linux

      It looks like in Queue (on or about line 520) the choose method tried to
      get the assigned label

      ...
      private JobOffer choose(Task p) {
      if (Hudson.getInstance().isQuietingDown())

      { // if we are quieting down, don't run anything so that // all executors will be free. return null; }

      Label l = p.getAssignedLabel();
      ...

      And for some reason, in the batch_task the owner is not set, therefore NPE!

      ...
      public Label getAssignedLabel()

      { --> Node on owner.getLastBuiltOn(); if(on==null) return null; return on.getSelfLabel(); }

      ...

      with the following trace.

      java.lang.NullPointerException
      at hudson.plugins.batch_task.BatchTask.getAssignedLabel(BatchTask.java:93)
      at hudson.model.Queue.choose(Queue.java:517)
      at hudson.model.Queue.pop(Queue.java:437)
      at hudson.model.Executor.run(Executor.java:72)

      As there are no tests around this task (shame shame) it is not clear how this is
      to work.

      I tried to put guards around the calls, but they are all over (shame shame,
      inline a method or something)

      This is killing slaves in our system.

      I am going to try to create a patch, and I may submit it. Not sure where you are
      at on this.

            kohsuke Kohsuke Kawaguchi
            javajoe1 javajoe1
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: