jenkinsci / jenkinsci/ec2-plugin
[JENKINS-55492] Plugin is not reusing stopped AWS EC2 instances
- Dominant language
- Java
- Stars
- 292
- Forks
- 709
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 4
Description
Using 1.39 of the plugin, the behaviour I observed was that when the instance cap was set to 2 and 2 slaves were already provisioned (e.g. in the stopped EC2 state rather than terminated), when a slave is required for a pending queued build, the plugin used to simply start one of the 2 stopped instances as required.
Now, on 1.42, the plugin appears to leave the previous 2 EC2 instances in the stopped state on AWS and provision a brand new slave, leading to it exceeding the instance cap of 2 and there now being 3 EC2 instances (albeit 2 stopped and only 1 running).
For now, my workaround was to go back to 1.39.
---
Originally reported by davidgoate, imported from: Plugin is not reusing stopped AWS EC2 instances
Raw content of original issue
Using 1.39 of the plugin, the behaviour I observed was that when the instance cap was set to 2 and 2 slaves were already provisioned (e.g. in the stopped EC2 state rather than terminated), when a slave is required for a pending queued build, the plugin used to simply start one of the 2 stopped instances as required.
Now, on 1.42, the plugin appears to leave the previous 2 EC2 instances in the stopped state on AWS and provision a brand new slave, leading to it exceeding the instance cap of 2 and there now being 3 EC2 instances (albeit 2 stopped and only 1 running).
For now, my workaround was to go back to 1.39.
- environment:
Plugin version 1.42
Contributor guide
Research direction
Start by tracing the EC2 plugin's instance provisioning and reuse behavior for stopped AWS instances, comparing the reported 1.39 and 1.42 behavior. Reproduce the case with a cap of 2 and two stopped instances; it is done when a queued build reuses a stopped instance and the cap is not exceeded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100