Skip to content

Commit

Permalink
Less verbose error message for lookup failure (apache#4135)
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored and rdhabalia committed Apr 25, 2019
1 parent 508fe22 commit 54db804
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import java.net.InetSocketAddress;
import java.net.URI;
import java.nio.channels.ClosedChannelException;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -140,8 +139,11 @@ private CompletableFuture<Pair<InetSocketAddress, InetSocketAddress>> findBroker
}
}).exceptionally((sendException) -> {
// lookup failed
log.warn("[{}] failed to send lookup request : {}", topicName.toString(), sendException.getMessage(),
sendException instanceof ClosedChannelException ? null : sendException);
log.warn("[{}] failed to send lookup request : {}", topicName.toString(), sendException.getMessage());
if (log.isDebugEnabled()) {
log.warn("[{}] Lookup response exception: {}", topicName.toString(), sendException);
}

addressFuture.completeExceptionally(sendException);
return null;
});
Expand Down Expand Up @@ -211,7 +213,7 @@ public CompletableFuture<List<String>> getTopicsUnderNamespace(NamespaceName nam
.setInitialTime(100, TimeUnit.MILLISECONDS)
.setMandatoryStop(opTimeoutMs.get() * 2, TimeUnit.MILLISECONDS)
.setMax(0, TimeUnit.MILLISECONDS)
.useUserConfiguredIntervals(client.getConfiguration().getDefaultBackoffIntervalNanos(),
.useUserConfiguredIntervals(client.getConfiguration().getDefaultBackoffIntervalNanos(),
client.getConfiguration().getMaxBackoffIntervalNanos())
.create();
getTopicsUnderNamespace(serviceNameResolver.resolveHost(), namespace, backoff, opTimeoutMs, topicsFuture, mode);
Expand Down

0 comments on commit 54db804

Please sign in to comment.