From 2bb74b261c44b5c9b1a9f3a312e9d447fac0886b Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Mon, 10 Jun 2024 17:27:02 -0500 Subject: [PATCH] Disable stale checking for local Docker daemon connections Fixes gh-40697 --- .../platform/docker/transport/LocalHttpClientTransport.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/LocalHttpClientTransport.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/LocalHttpClientTransport.java index cdafa07e40b..64b19c3cc2d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/LocalHttpClientTransport.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/LocalHttpClientTransport.java @@ -26,6 +26,7 @@ import com.sun.jna.Platform; import org.apache.hc.client5.http.DnsResolver; import org.apache.hc.client5.http.HttpRoute; import org.apache.hc.client5.http.classic.HttpClient; +import org.apache.hc.client5.http.config.ConnectionConfig; import org.apache.hc.client5.http.impl.classic.HttpClientBuilder; import org.apache.hc.client5.http.impl.classic.HttpClients; import org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager; @@ -73,8 +74,13 @@ final class LocalHttpClientTransport extends HttpClientTransport { */ private static class LocalConnectionManager extends BasicHttpClientConnectionManager { + private static final ConnectionConfig CONNECTION_CONFIG = ConnectionConfig.copy(ConnectionConfig.DEFAULT) + .setValidateAfterInactivity(TimeValue.NEG_ONE_MILLISECOND) + .build(); + LocalConnectionManager(String host) { super(getRegistry(host), null, null, new LocalDnsResolver()); + setConnectionConfig(CONNECTION_CONFIG); } private static Registry getRegistry(String host) {