Skip to content

Commit 6ddfe34

Browse files
committed
use createThreadFactory in InetSocketInitializer
1 parent 2e7d69f commit 6ddfe34

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ private interface NettyInitializer {
111111
DuplexChannel connect(final Bootstrap bootstrap) throws InterruptedException;
112112
}
113113

114+
private ThreadFactory createThreadFactory() {
115+
return new DefaultThreadFactory(THREAD_PREFIX, true, Thread.NORM_PRIORITY, DockerClientFactory.TESTCONTAINERS_THREAD_GROUP);
116+
}
117+
114118
private class UnixDomainSocketInitializer implements NettyInitializer {
115119
@Override
116120
public EventLoopGroup init(Bootstrap bootstrap, DockerClientConfig dockerClientConfig) {
@@ -122,10 +126,6 @@ public EventLoopGroup init(Bootstrap bootstrap, DockerClientConfig dockerClientC
122126
throw new RuntimeException("Unspported OS");
123127
}
124128

125-
private ThreadFactory createThreadFactory() {
126-
return new DefaultThreadFactory(THREAD_PREFIX, true, Thread.NORM_PRIORITY, DockerClientFactory.TESTCONTAINERS_THREAD_GROUP);
127-
}
128-
129129
public EventLoopGroup epollGroup() {
130130
EventLoopGroup epollEventLoopGroup = new EpollEventLoopGroup(0, createThreadFactory());
131131

@@ -163,7 +163,7 @@ public DuplexChannel connect(Bootstrap bootstrap) throws InterruptedException {
163163
private class InetSocketInitializer implements NettyInitializer {
164164
@Override
165165
public EventLoopGroup init(Bootstrap bootstrap, final DockerClientConfig dockerClientConfig) {
166-
EventLoopGroup nioEventLoopGroup = new NioEventLoopGroup(0, new DefaultThreadFactory(THREAD_PREFIX));
166+
EventLoopGroup nioEventLoopGroup = new NioEventLoopGroup(0, createThreadFactory());
167167

168168
// TODO do we really need BouncyCastle?
169169
Security.addProvider(new BouncyCastleProvider());

0 commit comments

Comments
 (0)