jenkinsci / jenkinsci/ec2-plugin
[JENKINS-57405] Stop/Disconnect on Idle Timeout feature not working after updating Node description template
- Dominant language
- Java
- Stars
- 292
- Forks
- 709
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 4
Description
Observed after upgrade from EC2 plugin 1.42 to 1.43.
When changing the "Description" of an EC2 node template in the Jenkins config, the "Stop/Disconnect on Idle Timeout" feature does not work anymore for any nodes created before the change.
The nodes stay stopped and new nodes are created instead of the old ones re-used.
This also happens for any nodes that were created on Jenkins with an EC2 plugin version <1.43. Because in 1.43 the node names are updated with more information to the instance name (PR-334 [1]).
This exception happens with that affect nodes, may be related:
```
May 10, 2019 9:55:53 AM hudson.model.AbstractCIBase updateComputer
WARNING: Error updating node EC2 (Mobility RD EU-West-1) - android-m52xlarge-eu-west-1 (i-009cd08cab2a1f2b2), continuing
java.lang.NullPointerException
at hudson.plugins.ec2.EC2RetentionStrategy.internalCheck(EC2RetentionStrategy.java:140)
at hudson.plugins.ec2.EC2RetentionStrategy.check(EC2RetentionStrategy.java:92)
at hudson.plugins.ec2.EC2RetentionStrategy.check(EC2RetentionStrategy.java:50)
at hudson.slaves.SlaveComputer$4.run(SlaveComputer.java:843)
at hudson.model.Queue._withLock(Queue.java:1381)
at hudson.model.Queue.withLock(Queue.java:1258)
at hudson.slaves.SlaveComputer.setNode(SlaveComputer.java:840)
at hudson.model.AbstractCIBase.updateComputer(AbstractCIBase.java:121)
at hudson.model.AbstractCIBase.access$000(AbstractCIBase.java:46)
at hudson.model.AbstractCIBase$2.run(AbstractCIBase.java:207)
at hudson.model.Queue._withLock(Queue.java:1381)
at hudson.model.Queue.withLock(Queue.java:1258)
at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:190)
at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1566)
at jenkins.model.Nodes$2.run(Nodes.java:138)
at hudson.model.Queue._withLock(Queue.java:1381)
at hudson.model.Queue.withLock(Queue.java:1258)
at jenkins.model.Nodes.addNode(Nodes.java:134)
at jenkins.model.Jenkins.addNode(Jenkins.java:2074)
at hudson.slaves.NodeProvisioner$2.run(NodeProvisioner.java:241)
at hudson.model.Queue._withLock(Queue.java:1381)
at hudson.model.Queue.withLock(Queue.java:1258)
at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:207)
at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:61)
at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:809)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72)
at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
```
[1] https://github.com/jenkinsci/ec2-plugin/pull/334
---
Originally reported by
sverhoef, imported from: Stop/Disconnect on Idle Timeout feature not working after updating Node description template
Raw content of original issue
Observed after upgrade from EC2 plugin 1.42 to 1.43.
When changing the "Description" of an EC2 node template in the Jenkins config, the "Stop/Disconnect on Idle Timeout" feature does not work anymore for any nodes created before the change.
The nodes stay stopped and new nodes are created instead of the old ones re-used.
This also happens for any nodes that were created on Jenkins with an EC2 plugin version <1.43. Because in 1.43 the node names are updated with more information to the instance name (PR-334 [1]).
This exception happens with that affect nodes, may be related:
May 10, 2019 9:55:53 AM hudson.model.AbstractCIBase updateComputer
WARNING: Error updating node EC2 (Mobility RD EU-West-1) - android-m52xlarge-eu-west-1 (i-009cd08cab2a1f2b2), continuing
java.lang.NullPointerException
at hudson.plugins.ec2.EC2RetentionStrategy.internalCheck(EC2RetentionStrategy.java:140)
at hudson.plugins.ec2.EC2RetentionStrategy.check(EC2RetentionStrategy.java:92)
at hudson.plugins.ec2.EC2RetentionStrategy.check(EC2RetentionStrategy.java:50)
at hudson.slaves.SlaveComputer$4.run(SlaveComputer.java:843)
at hudson.model.Queue._withLock(Queue.java:1381)
at hudson.model.Queue.withLock(Queue.java:1258)
at hudson.slaves.SlaveComputer.setNode(SlaveComputer.java:840)
at hudson.model.AbstractCIBase.updateComputer(AbstractCIBase.java:121)
at hudson.model.AbstractCIBase.access$000(AbstractCIBase.java:46)
at hudson.model.AbstractCIBase$2.run(AbstractCIBase.java:207)
at hudson.model.Queue._withLock(Queue.java:1381)
at hudson.model.Queue.withLock(Queue.java:1258)
at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:190)
at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1566)
at jenkins.model.Nodes$2.run(Nodes.java:138)
at hudson.model.Queue._withLock(Queue.java:1381)
at hudson.model.Queue.withLock(Queue.java:1258)
at jenkins.model.Nodes.addNode(Nodes.java:134)
at jenkins.model.Jenkins.addNode(Jenkins.java:2074)
at hudson.slaves.NodeProvisioner$2.run(NodeProvisioner.java:241)
at hudson.model.Queue._withLock(Queue.java:1381)
at hudson.model.Queue.withLock(Queue.java:1258)
at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:207)
at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:61)
at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:809)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72)
at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
- environment:
Jenkins ver. 2.150.1, EC2 plugin 1.43
Contributor guide
Research direction
Start at EC2RetentionStrategy.internalCheck, identified at line 140 in the stack trace, and review the node-name changes associated with PR-334. Reproduce the behavior across the 1.42-to-1.43 transition and confirm that changing a template description no longer causes a NullPointerException, leaves nodes stopped, or prevents idle nodes from being reused.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100