You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bound HTTP client timeouts and reclaim pooled connections
Fixes connection-pool exhaustion: a stalled read on the end-user
backend route was held indefinitely because the pooled HTTP clients
had no socket/read timeout (Apache default SO_TIMEOUT = 0 = infinite).
The worker thread blocked inside the read and never reached
Response.close(), so the leased connection was never returned. With
connectionRequestTimeout also unset, new requests blocked forever
waiting for a lease instead of failing fast, wedging the listener.
Adds socket timeout, connect timeout, connection TTL and
validate-after-inactivity to the pooled HTTP clients, applied only
when configured. Values are supplied via env vars through the existing
CATALINA_OPTS -> system property -> JAX-RS app constructor convention
(as connectionRequestTimeout already is), with image defaults in the
Dockerfile -- no hardcoded values in Java:
CLIENT_SOCKET_TIMEOUT -> ...linkeddatahub.socketTimeout
CLIENT_CONNECT_TIMEOUT -> ...linkeddatahub.connectTimeout
CLIENT_CONNECTION_TIME_TO_LIVE -> ...linkeddatahub.connectionTimeToLive
CLIENT_VALIDATE_AFTER_INACTIVITY -> ...linkeddatahub.validateAfterInactivity
SignUp: close the PublicKey/Agent/Authorization client Responses on
all paths (defense-in-depth; these leaked on the admin signup path).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@@ -1507,21 +1512,26 @@ public void submitImport(RDFImport rdfImport, com.atomgraph.linkeddatahub.apps.m
1507
1512
1508
1513
/**
1509
1514
* Builds JAX-RS client instance from given configuration.
1510
-
*
1515
+
*
1511
1516
* @param keyStore keystore
1512
1517
* @param keyStorePassword keystore password
1513
1518
* @param trustStore truststore
1514
1519
* @param maxConnPerRoute max connections per route
1515
1520
* @param maxTotalConn max total connections
1516
1521
* @param maxRequestRetries maximum number of times that the HTTP client will retry a request
1517
1522
* @param buffered true if request entity should be buffered
1523
+
* @param connectionRequestTimeout timeout in milliseconds to wait for a connection lease from the pool (null to leave unset)
1524
+
* @param socketTimeout socket (read) timeout in milliseconds (null to leave unset)
1525
+
* @param connectTimeout connection (connect) timeout in milliseconds (null to leave unset)
1526
+
* @param connectionTimeToLive time-to-live in milliseconds after which pooled connections are discarded (null to leave unset)
1527
+
* @param validateAfterInactivity period of inactivity in milliseconds after which a pooled connection is revalidated before reuse (null to leave unset)
@@ -1625,9 +1637,14 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje
1625
1637
* @param maxConnPerRoute max connections per route
1626
1638
* @param maxTotalConn max total connections
1627
1639
* @param maxRequestRetries maximum number of times that the HTTP client will retry a request
1640
+
* @param connectionRequestTimeout timeout in milliseconds to wait for a connection lease from the pool (null to leave unset)
1641
+
* @param socketTimeout socket (read) timeout in milliseconds (null to leave unset)
1642
+
* @param connectTimeout connection (connect) timeout in milliseconds (null to leave unset)
1643
+
* @param connectionTimeToLive time-to-live in milliseconds after which pooled connections are discarded (null to leave unset)
1644
+
* @param validateAfterInactivity period of inactivity in milliseconds after which a pooled connection is revalidated before reuse (null to leave unset)
0 commit comments