Skip to content

🐛 Regression: Jenkins EC2 spike agent template not provisioned when base is exhausted (since 2049) #2005

@zendesk-abhijeet

Description

@zendesk-abhijeet

Jenkins and plugins versions report

Environment

Plugin version(s):

  • Works: 2045.v06da_da_a_46422
  • Broken: 2049.v127f0f109c29

Jenkins version: 2.541.2
Cloud: EC2

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux Ubuntu for both. Jenkins controller is deployed in a k8s pod.

Reproduction steps

  1. Configure EC2 cloud with two templates that share the same label, e.g. my_agent.
    • Template 1: description my_agent base, instance cap small (e.g. 1)
    • Template 2: description my_agent spike, instance cap > 0
  2. Run jobs that require label my_agent so Template 1 reaches its cap.
  3. Observe that in 2045, Template 2 provisions; in 2049, Template 2 does not provision and jobs remain queued.

Expected Results

When multiple templates match a label, provisioning should try them in order:

  1. Attempt provisioning using the first template
  2. If it cannot satisfy demand (e.g., no possible new slaves / cap reached), continue to the next matching template. This is the behaviour we observed in 2045.

Actual Results

Only the first matching template appears to be considered for provisioning; the second template is not attempted, so spike capacity is not used even when base is exhausted.

Anything else?

  • Both templates are eligible for the label my_agent.
  • Base capacity is fully utilised at time of failure.

Are you interested in contributing a fix?

Can contribute with a patch to fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions