On Fri, 4 Feb 2022 14:11:49 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:
>> Hi, >> >> Could I get the following patch reviewed please? (A CSR is also required >> which I will submit when the docs are agreed) >> >> It adds a pair of new system properties to make the keep alive timer in >> java.net.HttpURLConnection configurable. >> The proposed property names are: >> >> "http.keepAlive.time.server" and "http.keepAlive.time.proxy" >> >> Thanks, >> Michael > > src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java line 159: > >> 157: int keepAliveTimeout = http.getKeepAliveTimeout(); >> 158: if (keepAliveTimeout == 0) { >> 159: keepAliveTimeout = >> getUserKeepAlive(http.getUsingProxy()); > > This could be 0 if -Dhttp.keepAlive.time.xxx=0 was specified which would > result in an assert below. > Also I am not sure I understand the logic of having same 5s timeout for > server & proxy if nothing was specified anywhere, but having a different > value for proxy & server if the server specified keep-alive without providing > a value. > Where does that come from? Ah, I meant to catch that case as well in the method where the property is read. Probably should be documented as well. The other behavior is just maintaining the present behavior, purely for compatibility reasons. ------------- PR: https://git.openjdk.java.net/jdk/pull/7349