Skip to content

chore: make the termination handler more robust#1322

Merged
kayman-mk merged 7 commits into
mainfrom
kayma/1298/shutdown-runners
Sep 18, 2025
Merged

chore: make the termination handler more robust#1322
kayman-mk merged 7 commits into
mainfrom
kayma/1298/shutdown-runners

Conversation

@kayman-mk

@kayman-mk kayman-mk commented Sep 18, 2025

Copy link
Copy Markdown
Collaborator

Description

In case the agent is terminated, we search for child instances which are 'running', 'pending', 'stopping', 'stopped'. All ol them are terminated. Furthermore we retry the termination call 3 times in case of exceptions.

This fixes the problem that sometimes a small amount ol EC2 instances remain in stopped state.

Fixes parts of #1298

@kayman-mk
kayman-mk requested a review from npalm as a code owner September 18, 2025 09:04
@github-actions

Copy link
Copy Markdown
Contributor

Hey @kayman-mk! 👋

Thank you for your contribution to the project. Please refer to the contribution rules for a quick overview of the process.

Make sure that this PR clearly explains:

  • the problem being solved
  • the best way a reviewer and you can test your changes

With submitting this PR you confirm that you hold the rights of the code added and agree that it will published under this LICENSE.

The following ChatOps commands are supported:

  • /help: notifies a maintainer to help you out

Simply add a comment with the command in the first line. If you need to pass more information, separate it with a blank line from the command.

This message was generated automatically. You are welcome to improve it.

@github-actions

github-actions Bot commented Sep 18, 2025

Copy link
Copy Markdown
Contributor

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 1.68s
✅ PYTHON bandit 1 0 0 0.78s
✅ PYTHON black 1 1 0 0 0.78s
✅ PYTHON flake8 1 0 0 0.36s
✅ PYTHON isort 1 1 0 0 0.16s
✅ PYTHON mypy 1 0 0 4.11s
❌ PYTHON pylint 1 2 0 7.35s
✅ PYTHON pyright 1 0 0 2.81s
✅ PYTHON ruff 1 1 0 0 0.02s
✅ REPOSITORY checkov yes no no 28.83s
✅ REPOSITORY dustilock yes no no 0.35s
✅ REPOSITORY gitleaks yes no no 0.76s
✅ REPOSITORY git_diff yes no no 0.01s
✅ REPOSITORY grype yes no no 25.37s
✅ REPOSITORY secretlint yes no no 0.63s
✅ REPOSITORY syft yes no no 0.98s
✅ REPOSITORY trivy-sbom yes no no 0.13s
✅ REPOSITORY trufflehog yes no no 3.6s
✅ SPELL cspell 3 0 0 3.12s
✅ TERRAFORM terraform-fmt 1 0 0 0 0.06s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@kayman-mk

Copy link
Copy Markdown
Collaborator Author

Not sure, why the linter fails ....

@kayman-mk
kayman-mk merged commit 759323a into main Sep 18, 2025
20 of 21 checks passed
@kayman-mk
kayman-mk deleted the kayma/1298/shutdown-runners branch September 18, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant