Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proxy] Remove unnecessary blocking DNS lookup in LookupProxyHandler #15415

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -215,20 +215,16 @@ public void handlePartitionMetadataResponse(CommandPartitionedTopicMetadata part
private void handlePartitionMetadataResponse(CommandPartitionedTopicMetadata partitionMetadata,
long clientRequestId) {
TopicName topicName = TopicName.get(partitionMetadata.getTopic());
URI brokerURI;
try {
String availableBrokerServiceURL = getBrokerServiceUrl(clientRequestId);
if (availableBrokerServiceURL == null) {
log.warn("No available broker for {} to lookup partition metadata", topicName);
return;
}
brokerURI = new URI(availableBrokerServiceURL);
} catch (URISyntaxException e) {
proxyConnection.ctx().writeAndFlush(Commands.newPartitionMetadataResponse(ServerError.MetadataError,
e.getMessage(), clientRequestId));

String serviceUrl = getBrokerServiceUrl(clientRequestId);
if (serviceUrl == null) {
log.warn("No available broker for {} to lookup partition metadata", topicName);
return;
}
InetSocketAddress addr = getAddr(serviceUrl, clientRequestId);
if (addr == null) {
return;
}
InetSocketAddress addr = new InetSocketAddress(brokerURI.getHost(), brokerURI.getPort());

if (log.isDebugEnabled()) {
log.debug("Getting connections to '{}' for Looking up topic '{}' with clientReq Id '{}'", addr,
Expand Down