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

Executor.getIdleStartMilliseconds throws NPE when executor == null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None

      Executables.getEstimatedDurationFor() throws NPE when the executable is null. This can happen if Computer.getIdleStartMilliseconds() is called before the executable is set to non-null in Computer.run() or if the executor thread exits prematurely

      We are seeing this in the mansion-cloud-plugin and I believe it is becuase the executor thread is dying prematurely. Restarting the thread fixes it.

      This issue causes other issues down the chain and prevents further provisioning and cleanup of mansion-cloud slaves.

      I'm unsure what the fix would be here. Possibly to return Long.MIN_VALUE if the executable is null (Look at Computer.getIdleStartMilliseconds())

      SEVERE: Timer task hudson.slaves.ComputerRetentionWork@110b47e0 failed
      java.lang.NullPointerException
            at hudson.model.queue.Executables.getEstimatedDurationFor(Executables.java:69)
            at hudson.model.Executor.getIdleStartMilliseconds(Executor.java:870)
            at hudson.model.Computer.getIdleStartMilliseconds(Computer.java:957)
            at com.cloudbees.jenkins.plugins.mtslavescloud.MansionComputer.getIdleStartMillisecondsAfterConnect(MansionComputer.java:171)
            at com.cloudbees.jenkins.plugins.mtslavescloud.MansionRetentionStrategy.isIdleForTooLong(MansionRetentionStrategy.java:103)
      
      

            varmenise valentina armenise
            hadashi Ivan Meredith
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: