Skip to content

Commit 2e7d69f

Browse files
committed
fail fast if the event loop is shutting down
1 parent 4a258a4 commit 2e7d69f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/main/java/org/testcontainers/dockerclient/transport/TestcontainersDockerCmdExecFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.util.concurrent.TimeUnit;
3838

3939
import static com.google.common.base.Preconditions.checkNotNull;
40+
import static com.google.common.base.Preconditions.checkState;
4041

4142
/**
4243
* This class is a modified version of docker-java's NettyDockerCmdExecFactory v3.1.0-rc-2
@@ -91,6 +92,8 @@ public void init(DockerClientConfig dockerClientConfig) {
9192
}
9293

9394
private DuplexChannel connect() {
95+
checkState(!eventLoopGroup.isShuttingDown(), "EventLoop is shutting down");
96+
9497
try {
9598
return connect(bootstrap);
9699
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)