Skip to content

Fix duct-tape:1.0.8 Zombie thread#9241

Open
dadoonet wants to merge 6 commits intotestcontainers:mainfrom
dadoonet:zombie-threads
Open

Fix duct-tape:1.0.8 Zombie thread#9241
dadoonet wants to merge 6 commits intotestcontainers:mainfrom
dadoonet:zombie-threads

Conversation

@dadoonet
Copy link
Contributor

This is a naive implementation for the bug described in #9227.

I basically moved the code from https://github.com/rnorth/duct-tape/ to org.testcontainers.utility.ducttape TC new package. And I removed the dependency on the duct-tape jar.
Then I added a method Timeouts.shutdown() which basically calls the shutdown() method on the Thread.
Finally, when we stop a container, I'm calling this Timeouts.shutdown().

This should close the remaining thread.

Let me know what you think and if I should continue on this path or not.

Thanks!

1st step: move code from the archived repository

Related to testcontainers#9227.
2nd step: call shutdown() when stopping the container

Related to testcontainers#9227.
@austince
Copy link

austince commented Mar 3, 2026

@dadoonet @eddumelendez , sorry for the ping -- is there any help that we could give to get this one merged?

I offer a genuine-human-spotted-and-crafted-bug-fix as initial offering testcontainers/testcontainers-site#252

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants