You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "kwin (via GitHub)" <gi...@apache.org> on 2023/03/28 08:55:32 UTC

[GitHub] [maven-resolver] kwin commented on a diff in pull request #274: [MRESOLVER-347] Ability to control conn reuse

kwin commented on code in PR #274:
URL: https://github.com/apache/maven-resolver/pull/274#discussion_r1150255649


##########
maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java:
##########
@@ -159,6 +159,37 @@ public final class ConfigurationProperties {
      */
     public static final boolean DEFAULT_HTTP_PREEMPTIVE_AUTH = false;
 
+    /**
+     * Should HTTP client reuse connections (in other words, pool connections) or not?
+     *
+     * @see #DEFAULT_HTTP_REUSE_CONNECTIONS
+     * @since 1.9.8
+     */
+    public static final String HTTP_REUSE_CONNECTIONS = PREFIX_CONNECTOR + "http.reuseConnections";
+
+    /**
+     * The default value to use if {@link #HTTP_REUSE_CONNECTIONS} isn't set (true).
+     *
+     * @since 1.9.8
+     */
+    public static final boolean DEFAULT_HTTP_REUSE_CONNECTIONS = true;
+
+    /**
+     * The maximum TTL (in milliseconds) HTTP client should apply to connections when reused.
+     *
+     * @see #DEFAULT_HTTP_CONNECTION_MAX_TTL
+     * @see <a href="https://hc.apache.org/httpcomponents-client-4.5.x/current/httpclient/apidocs/org/apache/http/conn/ConnectionKeepAliveStrategy.html">ConnectionKeepAliveStrategy</a>
+     * @since 1.9.8
+     */
+    public static final String HTTP_CONNECTION_MAX_TTL = PREFIX_CONNECTOR + "http.connectionMaxTtl";
+
+    /**
+     * The default value to use if {@link #HTTP_CONNECTION_MAX_TTL} isn't set (-1 or "no suggested duration"/forever).
+     *
+     * @since 1.9.8
+     */
+    public static final long DEFAULT_HTTP_CONNECTION_MAX_TTL = -1;

Review Comment:
   For me the value 300 seems rather arbitrary and I don't think this a good default. HttpClient has stale connection check which works in most cases so the -1 seem more reasonable to me as default (as it is the default of Apache HttpClient as well)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org