diff --git a/vcell-client/src/main/java/cbit/vcell/client/VCellClientMain.java b/vcell-client/src/main/java/cbit/vcell/client/VCellClientMain.java index 5fcfe9621b..b1f3c48f63 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/VCellClientMain.java +++ b/vcell-client/src/main/java/cbit/vcell/client/VCellClientMain.java @@ -80,6 +80,14 @@ private VCellClientMain() { * @param args an array of command-line arguments */ public static void main(java.lang.String[] args) { + // Recover gracefully when DNS lookups fail transiently (e.g. laptop wake from sleep). + // Java's default 10s negative-result cache combined with our continuous polling loop + // wedges the client at "connecting…" until restart, because the polling interval is + // shorter than the cache TTL so the cached failure never expires. A short positive + // TTL still gives reasonable cache locality without holding stale entries indefinitely. + java.security.Security.setProperty("networkaddress.cache.ttl", "30"); + java.security.Security.setProperty("networkaddress.cache.negative.ttl", "0"); + System.out.println("starting with arguments " + Arrays.asList(args)); int exitCode = 1; try {