⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@ChimdumebiNebolisa
Copy link

@ChimdumebiNebolisa ChimdumebiNebolisa commented Jan 16, 2026

What does this PR do?

Fixes an executor thread leak in LoadSimulationController and adds/updates tests to prevent regressions.

Why is this needed?

LoadSimulationController previously used a cached ExecutorService without a shutdown path, which can leave non-daemon threads running and delay or prevent clean JVM shutdown in embedded or containerized test environments.

What changed?

  • Converted the cached executor from static to instance-scoped.
  • Implemented AutoCloseable and added a close() method that shuts down the executor safely.
  • Ensured cleanup via finally in run().
  • Updated the JUnit 5 test to assert no leaked non-daemon pool threads remain after close().

How was this tested?

Updated JUnit 5 test creates a controller instance, forces executor thread creation, calls close(), and verifies the executor threads terminate.

Docs

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@github-actions
Copy link

@ChimdumebiNebolisa Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants