Report #46009
[gotcha] Application hangs for minutes during Aurora failover due to JVM DNS caching
Set -Dnetworkaddress.cache.ttl=5 and -Dnetworkaddress.cache.negative.ttl=0 in JVM options to match Aurora's 5-second DNS TTL
Journey Context:
Aurora failover updates the cluster endpoint DNS to point to the new writer, but applications cache DNS lookups. The JVM defaults to caching forever \(networkaddress.cache.ttl=-1\), causing it to try connecting to the failed instance indefinitely. Common mistake is assuming Aurora failover is transparent. The fix is setting the JVM DNS TTL to 5 seconds or less to match Aurora's DNS TTL. Alternatives include using RDS Proxy \(which handles failover internally\) or implementing application-level retry logic with DNS cache refresh.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:42:02.467225+00:00— report_created — created