[
https://issues.apache.org/jira/browse/HTTPCLIENT-2348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17893587#comment-17893587
]
Basil Crow commented on HTTPCLIENT-2348:
----------------------------------------
[~olegk] It is a bit more complicated than that for us. The [Jenkins Docker
plugin|https://plugins.jenkins.io/docker-plugin/] depends on the [Jenkins
Docker Java library plugin|https://plugins.jenkins.io/docker-java-api/] (a
repackaging of the upstream {{docker-java}} project), which itself depends on
the [Jenkins Apache HttpComponents Client 5.x library
plugin|https://plugins.jenkins.io/apache-httpcomponents-client-5-api/] (a
repackaging of the upstream {{httpclient5}} project). (The reason why we
repackage Java libraries as Jenkins plugins is to implement [dynamic
linking|https://en.wikipedia.org/wiki/Dynamic_linker] as described
[here|https://www.jenkins.io/doc/developer/plugin-development/dependencies-and-class-loading/].)
So we have downgraded to 5.3 in the Jenkins Apache HttpComponents Client 5.x
library plugin to restore service to our 44,437 users, but I am not sure if a
fix can be made in the Jenkins Docker plugin (since that is merely a consumer
of {{docker-java}} via the Jenkins Docker Java library plugin). Ideally
compatibility could be restored in {{{}httpclient5{}}}, but if not, then we
might have to wait for a fix in {{{}docker-java{}}}. That library does not look
to be actively maintained, but perhaps a fix would be more likely if an issue
were to be filed against {{{}docker-java{}}}.
> docker-java-transport-httpclient5 broken over Unix sockets (regression in 5.4)
> ------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-2348
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2348
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient (classic)
> Affects Versions: 5.4
> Reporter: Basil Crow
> Priority: Major
>
> h3. Steps to reproduce
> Clone [https://github.com/docker-java/docker-java.git] and apply
> {code:xml}
> diff --git a/docker-java-transport-httpclient5/pom.xml
> b/docker-java-transport-httpclient5/pom.xml
> index 48b751d5..808855f2 100644
> --- a/docker-java-transport-httpclient5/pom.xml
> +++ b/docker-java-transport-httpclient5/pom.xml
> @@ -29,7 +29,7 @@
> <dependency>
> <groupId>org.apache.httpcomponents.client5</groupId>
> <artifactId>httpclient5</artifactId>
> - <version>5.0.3</version>
> + <version>5.4</version>
> </dependency>
> {code}
> and run {{mvn clean verify -Dtest=HttpClient5Tests -DfailIfNoTests=false
> -DskipITs}}
> h3. Expected results
> {panel:title=Note}
> These are the _actual_ results with {{httpclient5}} 5.0.3 and 5.3.1.
> {panel}
> Tests pass.
> h4. Actual results
> Tests fail with
> {noformat}
> java.lang.RuntimeException:
> org.apache.hc.client5.http.HttpHostConnectException: Connect to
> unix://localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1]
> failed: Connection refused
> at
> com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:210)
> at
> com.github.dockerjava.httpclient5.ApacheDockerHttpClient.execute(ApacheDockerHttpClient.java:9)
> at
> com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:228)
> at
> com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:269)
> at java.base/java.lang.Thread.run(Thread.java:1583)
> Caused by: org.apache.hc.client5.http.HttpHostConnectException: Connect to
> unix://localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1]
> failed: Connection refused
> at java.base/sun.nio.ch.Net.pollConnect(Native Method)
> at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)
> at
> java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542)
> at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592)
> at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
> at java.base/java.net.Socket.connect(Socket.java:751)
> at
> org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:216)
> at
> org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:490)
> at
> org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:164)
> at
> org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:174)
> at
> org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:144)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:150)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:110)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:174)
> at
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87)
> at
> com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:206)
> {noformat}
> h3. Evaluation
> Bisection shows this regression was caused by
> {noformat}
> commit 851c8df9f
> Author: Oleg Kalnichevski <[email protected]>
> Date: Sun Jan 21 07:59:38 2024
> Move plain socket create and connect operations to
> HttpClientConnectionOperator
> {noformat}
> in [https://github.com/apache/httpcomponents-client/pull/540] by [~olegk].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]