Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8278067

Make HttpURLConnection default keep alive timeout configurable

XMLWordPrintable

    • b11

        HttpURLConnection keep alive times are currently set based on the presence of a Keep-Alive header which can specify a number of seconds to allow a TCP connection to remain idle in the cache before closing it. It's not clear how widely used this server set header is. Its default value is currently set to 60 sec for proxies, 5 sec for servers, which really should be configurable on the client side in cases where the server does not specify it.

        It would also be useful to log the amount of time a connection was in the keep alive cache when it is taken out and reused. This would assist when diagnosing race conditions when a connection is reused by the client and simultaneously closed by the server.

        To make this fix back-portable the config parameter needs to be a (jdk specific) system property.

              michaelm Michael McMahon
              michaelm Michael McMahon
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: