From 02a5c649e153220f83685af92676e0dfa1e132cb Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 22 Mar 2018 19:54:10 -0400 Subject: [PATCH 1/2] Add note to low-level client docs for DNS caching This commit adds a note to the low-level REST client docs regarding the possibility of being impacted by the JVM DNS cache policy under a default security manager policy. --- docs/java-rest/low-level/configuration.asciidoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/java-rest/low-level/configuration.asciidoc b/docs/java-rest/low-level/configuration.asciidoc index 54f7cd2817354..ff3ffe378c9b4 100644 --- a/docs/java-rest/low-level/configuration.asciidoc +++ b/docs/java-rest/low-level/configuration.asciidoc @@ -86,3 +86,16 @@ will be used. For any other required configuration needed, the Apache HttpAsyncClient docs should be consulted: https://hc.apache.org/httpcomponents-asyncclient-4.1.x/ . + +NOTE: If your application runs under the security manager you might be subject +to the JVM default policy of caching positive hostname resolutions indefinitely, +and caching negative hostname resolutions for ten seconds. If the resolved +addresses of the hosts to which you are connecting the client to vary with time +then you might want to modify the default JVM behavior. These can be modified by +adding +http://docs.oracle.com/javase/8/docs/technotes/guides/net/properties.html[`networkaddress.cache.ttl=`] +and +http://docs.oracle.com/javase/8/docs/technotes/guides/net/properties.html[`networkaddress.cache.negative.ttl=`] +to your +http://docs.oracle.com/javase/8/docs/technotes/guides/security/PolicyFiles.html[Java +security policy]. From 54bda4e9e204e3188df62973590759079f44750f Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 22 Mar 2018 19:56:42 -0400 Subject: [PATCH 2/2] Slight reword --- docs/java-rest/low-level/configuration.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/java-rest/low-level/configuration.asciidoc b/docs/java-rest/low-level/configuration.asciidoc index ff3ffe378c9b4..b0753496558bb 100644 --- a/docs/java-rest/low-level/configuration.asciidoc +++ b/docs/java-rest/low-level/configuration.asciidoc @@ -88,8 +88,8 @@ For any other required configuration needed, the Apache HttpAsyncClient docs should be consulted: https://hc.apache.org/httpcomponents-asyncclient-4.1.x/ . NOTE: If your application runs under the security manager you might be subject -to the JVM default policy of caching positive hostname resolutions indefinitely, -and caching negative hostname resolutions for ten seconds. If the resolved +to the JVM default policies of caching positive hostname resolutions +indefinitely and negative hostname resolutions for ten seconds. If the resolved addresses of the hosts to which you are connecting the client to vary with time then you might want to modify the default JVM behavior. These can be modified by adding