Chat Logs

  1. XatenevHello, can anyone confirm that the standard JVM TTL of the DNS cache for java 21 is 30 seconds?
  2. XatenevThe 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. XatenevWhich seems to be a thing and I just want to make sure that it will not interfere with the plan
  4. XatenevWith 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. ernimrilyou can configure it if you want: networkaddress.cache.ttl
  6. ernimriland 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. XatenevI 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. ernimrilit was too long since I actually looked at the code, but gemini seems to agree that 30 seconds is the default now
  9. NeXeNhttps://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/doc-files/net-properties.html
  10. nevetNetworking Properties (Java SE 21 & JDK 21)
  11. NeXeNhttps://bugs.openjdk.org/browse/JDK-8306653
  12. nevetLoading...
  13. NeXeNhttps://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. javabotNeXeN's title: "openjdk-jdk11/src/java.base/share/classes/sun/net/InetAddressCachePolicy.java at master 路 AdoptOpenJDK/openjdk-jdk11 路 GitHub"