Skip to content

Commit 35bec14

Browse files
committed
Merge branch 'master-docker-java'
2 parents 8933038 + a760dd5 commit 35bec14

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Notes
1010

1111
All changes
1212

13+
Included in 3.0.0-RC5
14+
1315
* [#542] (https://github.com/docker-java/docker-java/pull/542) Fix large volumes of output from "docker exec" trigger out of memory error
1416
* [#541] (https://github.com/docker-java/docker-java/pull/541) ImageInspectResponse.GraphDriver.Data is more complex structure
1517
* [#534] (https://github.com/docker-java/docker-java/pull/534) Fix create volume command doesn't assign passed in volume driverOpts to field

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Supports a subset of the Docker Remote API [v1.22](https://github.com/docker/doc
7272
<dependency>
7373
<groupId>com.github.docker-java</groupId>
7474
<artifactId>docker-java</artifactId>
75-
<version>3.0.0-RC4</version>
75+
<version>3.0.0-RC5</version>
7676
</dependency>
7777

7878
### Latest development version

src/main/java/com/github/dockerjava/jaxrs/async/AbstractCallbackNotifier.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.util.concurrent.ExecutorService;
1111
import java.util.concurrent.Executors;
1212
import java.util.concurrent.Future;
13+
import java.util.concurrent.ThreadFactory;
1314

1415
import javax.ws.rs.ProcessingException;
1516
import javax.ws.rs.client.Invocation.Builder;
@@ -18,13 +19,17 @@
1819
import com.github.dockerjava.api.async.ResultCallback;
1920
import com.github.dockerjava.core.async.ResponseStreamProcessor;
2021
import com.github.dockerjava.jaxrs.util.WrappedResponseInputStream;
22+
import com.google.common.util.concurrent.ThreadFactoryBuilder;
2123

2224
public abstract class AbstractCallbackNotifier<T> implements Callable<Void> {
2325

2426
private final ResponseStreamProcessor<T> responseStreamProcessor;
2527

2628
private final ResultCallback<T> resultCallback;
2729

30+
private static final ThreadFactory FACTORY =
31+
new ThreadFactoryBuilder().setDaemon(true).setNameFormat("dockerjava-jaxrs-async-%d").build();
32+
2833
protected final Builder requestBuilder;
2934

3035
protected AbstractCallbackNotifier(ResponseStreamProcessor<T> responseStreamProcessor,
@@ -76,7 +81,7 @@ public Void call() throws Exception {
7681

7782
public static <T> Future<Void> startAsyncProcessing(AbstractCallbackNotifier<T> callbackNotifier) {
7883

79-
ExecutorService executorService = Executors.newSingleThreadExecutor();
84+
ExecutorService executorService = Executors.newSingleThreadExecutor(FACTORY);
8085
Future<Void> response = executorService.submit(callbackNotifier);
8186
executorService.shutdown();
8287
return response;

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)