Skip to content

Commit de2627d

Browse files
authored
Disable socket timeout of 3min introduced in #1590 (#1702)
1 parent dd17358 commit de2627d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docker-java-transport-httpclient5/src/main/java/com/github/dockerjava/httpclient5/ApacheDockerHttpClientImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
import org.apache.hc.core5.http.config.RegistryBuilder;
2525
import org.apache.hc.core5.http.impl.DefaultContentLengthStrategy;
2626
import org.apache.hc.core5.http.impl.io.EmptyInputStream;
27+
import org.apache.hc.core5.http.io.SocketConfig;
2728
import org.apache.hc.core5.http.io.entity.ByteArrayEntity;
2829
import org.apache.hc.core5.http.io.entity.InputStreamEntity;
2930
import org.apache.hc.core5.http.protocol.BasicHttpContext;
3031
import org.apache.hc.core5.http.protocol.HttpContext;
3132
import org.apache.hc.core5.net.URIAuthority;
33+
import org.apache.hc.core5.util.Timeout;
3234
import org.slf4j.Logger;
3335
import org.slf4j.LoggerFactory;
3436

@@ -93,6 +95,12 @@ protected ApacheDockerHttpClientImpl(
9395
null
9496
)
9597
);
98+
// See https://github.com/docker-java/docker-java/pull/1590#issuecomment-870581289
99+
connectionManager.setDefaultSocketConfig(
100+
SocketConfig.copy(SocketConfig.DEFAULT)
101+
.setSoTimeout(Timeout.ZERO_MILLISECONDS)
102+
.build()
103+
);
96104
connectionManager.setMaxTotal(maxConnections);
97105
connectionManager.setDefaultMaxPerRoute(maxConnections);
98106
RequestConfig.Builder defaultRequest = RequestConfig.custom();

0 commit comments

Comments
 (0)