ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. Xatenev Hello, can anyone confirm that the standard JVM TTL of the DNS cache for java 21 is 30 seconds?
  2. Xatenev The context of the question is that we are looking to change what the DNS entry of our JDBC url is pointing to. My current understanding is that the hikari connection pool should silently build new connections after the maxLifetime has been reached. These new connections should then point to the new DNS entry without any application restart needed. Now I learned about the JVM DNS cache
  3. Xatenev Which seems to be a thing and I just want to make sure that it will not interfere with the plan
  4. Xatenev With the default setting of 30 seconds, it should realize that the DNS is now pointing to a new place and build the connection to the new target in my understanding
  5. ernimril you can configure it if you want: networkaddress.cache.ttl
  6. ernimril and note that there are some libs/modules/applications that use alternative dns lookups (see dnsjava for an alternative library where you have more control over how dns is handled)
  7. Xatenev I don't want to configure it, in fact I cant really change any of these properties on our production servers anyways, but I doubt they have set anything for that specifically
  8. ernimril it was too long since I actually looked at the code, but gemini seems to agree that 30 seconds is the default now
  9. NeXeN https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/doc-files/net-properties.html
  10. nevet Networking Properties (Java SE 21 & JDK 21)
  11. NeXeN https://bugs.openjdk.org/browse/JDK-8306653
  12. nevet Loading...
  13. NeXeN https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/src/java.base/share/classes/sun/net/InetAddressCachePolicy.java line 48 public static final int DEFAULT_POSITIVE = 30;
  14. javabot NeXeN's title: "openjdk-jdk11/src/java.base/share/classes/sun/net/InetAddressCachePolicy.java at master · AdoptOpenJDK/openjdk-jdk11 · GitHub"