Skip to content

Fail getEC2HostAddress for a terminated instance#1126

Merged
res0nance merged 2 commits intojenkinsci:masterfrom
jglick:getEC2HostAddress
Aug 2, 2025
Merged

Fail getEC2HostAddress for a terminated instance#1126
res0nance merged 2 commits intojenkinsci:masterfrom
jglick:getEC2HostAddress

Conversation

@jglick
Copy link
Copy Markdown
Member

@jglick jglick commented Jul 31, 2025

Extracted from #1121.

While testing without #1125, as I recall (not sure exactly how to reproduce), I ran into some cases where the metadata inside the Jenkins controller was apparently out of date and there was an EC2 agent definition that corresponded to an instance which had already been terminated. This was not handled gracefully: the launch log went into a loop whereby it would claim that the hostname was not yet ready and it was going to sleep and try again in a few seconds. Clearly at this point the agent cannot be launched because the instance is gone, so it should fail early and clearly. With this patch, the agent definition gets deleted automatically.

jglick added 2 commits July 31, 2025 18:02
(cherry picked from commit cd0d436)
@res0nance res0nance merged commit 22c3366 into jenkinsci:master Aug 2, 2025
17 checks passed
@jglick jglick deleted the getEC2HostAddress branch August 4, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants