Open
Conversation
Reduce log clutter, move Elastic CI Mode "banner" to NewScaler(), so it's printed only once instead of each iteration (could be 5-6 times before the 2 minutes default timeout is hit).
petetomasik
reviewed
Feb 2, 2026
Contributor
petetomasik
left a comment
There was a problem hiding this comment.
Some comments/questions added.
ea65159 to
a7ce02f
Compare
18a9e14 to
95fc49c
Compare
95fc49c to
aa524d1
Compare
scadu
added a commit
that referenced
this pull request
Feb 5, 2026
Addresses #280 (comment) Fixes missing marker during initial implementation #212 where `SIGTERM` could be sent twice to the same instance, resulting in stopping agent process immediately, without giving ongoing jobs a chance to finish.
f856db8 to
5013210
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the dangling instance detection in Elastic CI Mode to support Windows instances. The scaler now correctly detects Windows platform and uses PowerShell to check agent service status.
Changes
strings.EqualFoldfor case-insensitive comparison (EC2 API returns"windows"lowercase, SDK constant is"Windows")AWS-RunPowerShellScriptfor Windows,AWS-RunShellScriptfor Linuxnssm status buildkite-agentto detect service stateautoscaling:SetInstanceHealthandAWS-RunPowerShellScriptto the Lambda roleTesting
To test dangling instance mechanism, I did:
terminate-instance.ps1toterminate-instance.ps1.bak, so it's not triggered via systemd/nssm post-exit eventbuildkite-agentservice and let the Agent Scaler do its jobSample logs: