diff --git a/joyqueue-client/joyqueue-client-core/src/main/java/org/joyqueue/client/internal/cluster/MetadataUpdater.java b/joyqueue-client/joyqueue-client-core/src/main/java/org/joyqueue/client/internal/cluster/MetadataUpdater.java index 8425da58c..a942bbba4 100644 --- a/joyqueue-client/joyqueue-client-core/src/main/java/org/joyqueue/client/internal/cluster/MetadataUpdater.java +++ b/joyqueue-client/joyqueue-client-core/src/main/java/org/joyqueue/client/internal/cluster/MetadataUpdater.java @@ -121,10 +121,11 @@ public TopicMetadata updateTopicMetadata(String topic, String app) { } catch (Exception e) { logger.error("update topic metadata exception, topic: {}, app: {}", topic, app, e); - if (metadataCacheManager.getTopicMetadata(topic, app) == null) { - metadataCacheManager.putTopicMetadata(topic, app, new TopicMetadata(JoyQueueCode.CN_SERVICE_NOT_AVAILABLE)); - } - return null; +// if (metadataCacheManager.getTopicMetadata(topic, app) == null) { +// metadataCacheManager.putTopicMetadata(topic, app, new TopicMetadata(JoyQueueCode.CN_SERVICE_NOT_AVAILABLE)); +// } +// return null; + throw e; } } diff --git a/joyqueue-common/joyqueue-toolkit/src/main/java/org/joyqueue/toolkit/network/IpUtil.java b/joyqueue-common/joyqueue-toolkit/src/main/java/org/joyqueue/toolkit/network/IpUtil.java index bf9984b00..c001beaae 100644 --- a/joyqueue-common/joyqueue-toolkit/src/main/java/org/joyqueue/toolkit/network/IpUtil.java +++ b/joyqueue-common/joyqueue-toolkit/src/main/java/org/joyqueue/toolkit/network/IpUtil.java @@ -227,6 +227,10 @@ public static String toAddress(final SocketAddress address) { InetSocketAddress isa = (InetSocketAddress) address; StringBuilder builder = new StringBuilder(50); if (address instanceof InetSocketAddress) { + InetAddress ia = isa.getAddress(); + if (ia == null) { + throw new RuntimeException("UnknownHost[" + ((InetSocketAddress) address).getHostName() + "]"); + } builder.append(isa.getAddress().getHostAddress()); String separator = isValidIpV4Address(((InetSocketAddress) address).getHostString()) ? IPV4_PORT_SEPARATOR : IPV6_PORT_SEPARATOR; builder.append(separator).append(isa.getPort()); @@ -986,4 +990,4 @@ public static boolean isValidIpV4Address(String value) { } -} +} \ No newline at end of file