Set timeouts on request (in addition to client)
@@ -33,6 +33,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -182,6 +183,8 @@ class HealthCheckProxyHandler extends HandlerWrapper {
private StatusResponse getStatusResponse() {
try {
var request = client().newRequest("https://localhost:" + port + HEALTH_CHECK_PATH);
+ request.timeout(timeout.toMillis(), TimeUnit.MILLISECONDS);
+ request.idleTimeout(timeout.toMillis(), TimeUnit.MILLISECONDS);
if (proxyProtocol) {
request.tag(new ProxyProtocolClientConnectionFactory.V1.Tag());
}
