FIX: Don't remove EC2 instance when fails to remove githubRunner #904
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.
removeGithubRunner[Org || Repo]used to remove the EC2 instance, so no need to callterminateRunneragain. This potentially could cause runners that failed to be unregistered from GHA to be terminated on EC2.As a fix,
removeGithubRunnerwon't terminate the instance, nor generate logs. This will enablescaleDownto control when to callterminateRunnerand generate the proper logs and metrics. Avoiding having this issue in the future.This bug also explains why we had in the past more EC2 instances being kept at its minimum time: instances with less than minimum time got unregistered and terminated without being tracked on main application metric. This is obvious when we compare the API calls to terminate and the count of app level termination.
Bug initially flagged on 87134