You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/01/27 17:33:28 UTC

[GitHub] merlimat closed pull request #1121: Remove stack traces from topic lookup errors during unloads

merlimat closed pull request #1121: Remove stack traces from topic lookup errors during unloads
URL: https://github.com/apache/incubator-pulsar/pull/1121
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/DestinationLookup.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/DestinationLookup.java
index 52a17b916..a666166c4 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/DestinationLookup.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/DestinationLookup.java
@@ -26,6 +26,7 @@
 import java.net.URISyntaxException;
 import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionException;
 
 import javax.ws.rs.DefaultValue;
 import javax.ws.rs.Encoded;
@@ -281,18 +282,29 @@ public String getNamespaceBundle(@PathParam("destination-domain") String destina
                                         newLookupResponse(lookupData.getBrokerUrl(), lookupData.getBrokerUrlTls(),
                                                 true /* authoritative */, LookupType.Connect, requestId, false));
                             }
-                        }).exceptionally(e -> {
-                            log.warn("Failed to lookup {} for topic {} with error {}", clientAppId, fqdn.toString(),
-                                    e.getMessage(), e);
+                        }).exceptionally(ex -> {
+                            if (ex instanceof CompletionException && ex.getCause() instanceof IllegalStateException) {
+                                log.info("Failed to lookup {} for topic {} with error {}", clientAppId, fqdn.toString(),
+                                        ex.getCause().getMessage());
+                            } else {
+                                log.warn("Failed to lookup {} for topic {} with error {}", clientAppId, fqdn.toString(),
+                                        ex.getMessage(), ex);
+                            }
                             lookupfuture.complete(
-                                    newLookupErrorResponse(ServerError.ServiceNotReady, e.getMessage(), requestId));
+                                    newLookupErrorResponse(ServerError.ServiceNotReady, ex.getMessage(), requestId));
                             return null;
                         });
             }
 
         }).exceptionally(ex -> {
-            log.warn("Failed to lookup {} for topic {} with error {}", clientAppId, fqdn.toString(), ex.getMessage(),
-                    ex);
+            if (ex instanceof CompletionException && ex.getCause() instanceof IllegalStateException) {
+                log.info("Failed to lookup {} for topic {} with error {}", clientAppId, fqdn.toString(),
+                        ex.getCause().getMessage());
+            } else {
+                log.warn("Failed to lookup {} for topic {} with error {}", clientAppId, fqdn.toString(),
+                        ex.getMessage(), ex);
+            }
+
             lookupfuture.complete(newLookupErrorResponse(ServerError.ServiceNotReady, ex.getMessage(), requestId));
             return null;
         });


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services