Skip to content

Commit 4135555

Browse files
author
Marcus Linke
committed
rename netty worker threads
1 parent 741492c commit 4135555

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/com/github/dockerjava/netty/DockerCmdExecFactoryImpl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
import io.netty.handler.codec.http.HttpClientCodec;
120120
import io.netty.handler.logging.LoggingHandler;
121121
import io.netty.handler.ssl.SslHandler;
122+
import io.netty.util.concurrent.DefaultThreadFactory;
122123

123124
import org.bouncycastle.jce.provider.BouncyCastleProvider;
124125

@@ -148,6 +149,8 @@
148149
*/
149150
public class DockerCmdExecFactoryImpl implements DockerCmdExecFactory {
150151

152+
private static String threadPrefix = "dockerjava-netty";
153+
151154
/*
152155
* useful links:
153156
*
@@ -215,7 +218,7 @@ private interface NettyInitializer {
215218
private class UnixDomainSocketInitializer implements NettyInitializer {
216219
@Override
217220
public EventLoopGroup init(Bootstrap bootstrap, DockerClientConfig dockerClientConfig) {
218-
EventLoopGroup epollEventLoopGroup = new EpollEventLoopGroup();
221+
EventLoopGroup epollEventLoopGroup = new EpollEventLoopGroup(0, new DefaultThreadFactory(threadPrefix));
219222
bootstrap.group(epollEventLoopGroup).channel(EpollDomainSocketChannel.class)
220223
.handler(new ChannelInitializer<UnixChannel>() {
221224
@Override
@@ -235,7 +238,7 @@ public DuplexChannel connect(Bootstrap bootstrap) throws InterruptedException {
235238
private class InetSocketInitializer implements NettyInitializer {
236239
@Override
237240
public EventLoopGroup init(Bootstrap bootstrap, final DockerClientConfig dockerClientConfig) {
238-
EventLoopGroup nioEventLoopGroup = new NioEventLoopGroup();
241+
EventLoopGroup nioEventLoopGroup = new NioEventLoopGroup(0, new DefaultThreadFactory(threadPrefix));
239242

240243
InetAddress addr = InetAddress.getLoopbackAddress();
241244

0 commit comments

Comments
 (0)