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

[incubator-pulsar] branch master updated: Remove stack traces from topic lookup errors during unloads (#1121)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e60a98  Remove stack traces from topic lookup errors during unloads (#1121)
4e60a98 is described below

commit 4e60a98375dc461c891693c5ff0dbc198e80a645
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Sat Jan 27 09:33:24 2018 -0800

    Remove stack traces from topic lookup errors during unloads (#1121)
---
 .../pulsar/broker/lookup/DestinationLookup.java    | 24 ++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

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 52a17b9..a666166 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.URI;
 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 class DestinationLookup extends PulsarWebResource {
                                         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;
         });

-- 
To stop receiving notification emails like this one, please contact
mmerli@apache.org.