Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3961,9 +3961,17 @@ public ExecuteProceduresResponse executeProcedures(RpcController controller,
public GetAllBootstrapNodesResponse getAllBootstrapNodes(RpcController controller,
GetAllBootstrapNodesRequest request) throws ServiceException {
GetAllBootstrapNodesResponse.Builder builder = GetAllBootstrapNodesResponse.newBuilder();
server.getBootstrapNodes()
.forEachRemaining(server -> builder.addNode(ProtobufUtil.toServerName(server)));
return builder.build();
try {
checkOpen();
if (server.getBootstrapNodes() == null || !server.getBootstrapNodes().hasNext()) {
throw new IOException("BootstrapNodes are not initialized yet. Please try again later.");
}
server.getBootstrapNodes()
.forEachRemaining(server -> builder.addNode(ProtobufUtil.toServerName(server)));
return builder.build();
} catch (IOException e) {
throw new ServiceException(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only need to wrap checkOpen here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CheckOpen only ensures that getBootstrapNodes is non-null, but it does not guarantee whether getBootstrapNodes has successfully retrieved the nodes. Therefore, additional validation is needed to ensure completeness.
Please help review this.

}
}

private void setReloadableGuardrails(Configuration conf) {
Expand Down