Skip to content

Commit

Permalink
throw exception when listHosts failed (vesoft-inc#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 committed Oct 22, 2024
1 parent 66f69cb commit 0a21fb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,11 @@ public synchronized Set<HostAddr> listHosts() {
}
} catch (TException e) {
LOGGER.error("listHosts error", e);
return null;
throw new RuntimeException("listHosts error", e);
}
if (resp.getCode() != ErrorCode.SUCCEEDED) {
LOGGER.error("listHosts execute failed, errorCode: " + resp.getCode());
return null;
throw new RuntimeException("listHosts execute failed, errorCode:" + resp.getCode());
}
Set<HostAddr> hostAddrs = new HashSet<>();
for (HostItem hostItem : resp.hosts) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,6 @@ public void updateLeader(String spaceName, int part, HostAddr newLeader)
*/
public Set<HostAddr> listHosts() {
Set<HostAddr> hosts = metaClient.listHosts();
if (hosts == null) {
return new HashSet<>();
}
if (!storageAddressMapping.isEmpty()) {
hosts = hosts
.stream()
Expand Down

0 comments on commit 0a21fb6

Please sign in to comment.