diff --git a/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java b/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java index 13682157a..0c8e0014e 100644 --- a/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java +++ b/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java @@ -168,11 +168,14 @@ private void getClient(String host, int port) } } - private void freshClient(HostAddr leader) - throws TTransportException { + private void freshClient(HostAddr leader) throws TTransportException { close(); try { - getClient(leader.getHost(), leader.getPort()); + if (leader.getHost() == null || "".equals(leader.getHost())) { + doConnect(); + } else { + getClient(leader.getHost(), leader.getPort()); + } } catch (ClientServerIncompatibleException e) { LOGGER.error(e.getMessage()); }