Repository navigation
[JENKINS-30456] Executor.getIdleStartMilliseconds throws NPE when executor == null #21398
Description
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)
Originally reported by hadashi, imported from: Executor.getIdleStartMilliseconds throws NPE when executor == null
- assignee: varmenise
- status: Resolved
- priority: Minor
- component(s): core
- resolution: Fixed
- resolved: 2015-11-17T14:12:32+00:00
- votes: 0
- watchers: 4
- imported: 2025-11-24
Raw content of original issue
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)
Activity
jenkins-infra-bot commentedon Oct 17, 2015
Raw content of original comment:
Code changed in jenkins
User: Valentina Armenise
Path:
core/src/main/java/hudson/model/queue/Executables.java
http://jenkins-ci.org/commit/jenkins/67e2637a57be9b6817621dbfcdec2b2dc27afdb9
Log:
JENKINS-30456Executable can be null in getEstimatedDurationForjenkins-infra-bot commentedon Oct 17, 2015
Raw content of original comment:
Code changed in jenkins
User: Oleg Nenashev
Path:
core/src/main/java/hudson/model/queue/Executables.java
http://jenkins-ci.org/commit/jenkins/9bba7c5fa3234c674eb7866618995fd5a22d79d8
Log:
Merge pull request #1873 from varmenise/
JENKINS-30456JENKINS-30456Executable can be null in getEstimatedDurationForCompare: 858849e...9bba7c5
jenkins-infra-bot commentedon Oct 17, 2015
Raw content of original comment:
Code changed in jenkins
User: Oleg Nenashev
Path:
changelog.html
http://jenkins-ci.org/commit/jenkins/bc254648870c1d7602b8218909b11c47d1cadb49
Log:
Noting
JENKINS-30456from #1873jenkins-infra-bot commentedon Oct 17, 2015
Raw content of original comment:
o.v.nenashev : bc254648870c1d7602b8218909b11c47d1cadb49 Files :
Integrated in
jenkins_main_trunk #4329
JENKINS-30456Executable can be null in getEstimatedDurationFor (Revision 67e2637)Noting
JENKINS-30456from #1873 (Revision bc25464)Result = SUCCESS
valentina.armenise : 67e2637a57be9b6817621dbfcdec2b2dc27afdb9
Files :
o.v.nenashev : bc254648870c1d7602b8218909b11c47d1cadb49
Files :
jenkins-infra-bot commentedon Nov 17, 2015
Raw content of original comment:
varmenise Has your commit resolves this issue?
In general, please remember to write [FIX
JENKINS-12345] to indicate that. See https://wiki.jenkins-ci.org/display/JENKINS/contributing section "Commit Messages"jenkins-infra-bot commentedon Nov 17, 2015
varmenise:
Raw content of original comment:
yes, this one 67e2637. I forgot 'FIX' sry