Executor.getIdleStartMilliseconds throws NPE when executor == null

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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)
      
      

            Assignee:
            valentina armenise
            Reporter:
            Ivan Meredith
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: