Skip to content

Zombie threads poc#1561

Merged
dadoonet merged 2 commits intodadoonet:zombie-threadsfrom
rnorth:zombie-threads-poc
Mar 6, 2026
Merged

Zombie threads poc#1561
dadoonet merged 2 commits intodadoonet:zombie-threadsfrom
rnorth:zombie-threads-poc

Conversation

@rnorth
Copy link

@rnorth rnorth commented Mar 6, 2026

@dadoonet I'm not sure if you're still tracking this PR but I wanted to lend a hand. There seems to be a subtle bug in your fix - as the executor service is a singleton, shutting it down from GenericContainer causes any future attempts to use timeouts to fail.

This PR-to-your-PR adds a test demonstrating the problem (d506b0c) and a tweak so that we still shut down the executor but replace it with a fresh one (d17370b).

We could merge this in to your PR or directly into origin - your choice 🙇

@rnorth rnorth marked this pull request as ready for review March 6, 2026 09:47
rnorth and others added 2 commits March 6, 2026 10:45
Demonstrates that calling Timeouts.shutdown() (as GenericContainer.stop()
does in this PR) permanently kills the static shared ExecutorService,
causing all subsequent Timeouts usage to fail with
RejectedExecutionException. This breaks any test suite that stops one
container and then starts another.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the static final ExecutorService with a lazily-created one so
that shutdown() doesn't permanently break subsequent container operations.
The executor is re-created transparently on next use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dadoonet dadoonet merged commit 2ae334d into dadoonet:zombie-threads Mar 6, 2026
3 of 6 checks passed
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.

2 participants