jenkinsci / jenkinsci/ec2-plugin

[JENKINS-55492] Plugin is not reusing stopped AWS EC2 instances

Open
#1,641 7 comments 0 reactions 0 assignees View on GitHub
component:ec2-plugin imported-jira-issue priority:major resolution:unresolved
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


  • assignee: thoulen
  • status: Open
  • priority: Major
  • component(s): ec2-plugin
  • resolution: Unresolved
  • votes: 3
  • watchers: 10
  • imported: 2025-12-06

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.