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

technoboy pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new ec7bd2a2b75 [improve][broker] Avoid print redirect exception log when 
get list from bundle (#20846)
ec7bd2a2b75 is described below

commit ec7bd2a2b75ecdf59222adc19c2398e1f0f40e3b
Author: Kai Wang <[email protected]>
AuthorDate: Sun Jul 23 12:56:04 2023 +0800

    [improve][broker] Avoid print redirect exception log when get list from 
bundle (#20846)
---
 .../pulsar/broker/admin/v2/NonPersistentTopics.java | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java
index 372bb016252..2274b8a6458 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java
@@ -463,25 +463,20 @@ public class NonPersistentTopics extends PersistentTopics 
{
                             }
                             asyncResponse.resume(topicList);
                         }).exceptionally(ex -> {
-                            Throwable realCause = 
FutureUtil.unwrapCompletionException(ex);
-                            log.error("[{}] Failed to list topics on namespace 
bundle {}/{}", clientAppId(),
-                                    namespaceName, bundleRange, realCause);
-                            if (realCause instanceof WebApplicationException) {
-                                asyncResponse.resume(realCause);
-                            } else {
-                                asyncResponse.resume(new 
RestException(realCause));
+                            if (!isRedirectException(ex)) {
+                                log.error("[{}] Failed to list topics on 
namespace bundle {}/{}", clientAppId(),
+                                        namespaceName, bundleRange, ex);
                             }
+                            resumeAsyncResponseExceptionally(asyncResponse, 
ex);
                             return null;
                         });
             }
         }).exceptionally(ex -> {
-            log.error("[{}] Failed to list topics on namespace bundle {}/{}", 
clientAppId(),
-                namespaceName, bundleRange, ex);
-            if (ex.getCause() instanceof WebApplicationException) {
-                asyncResponse.resume(ex.getCause());
-            } else {
-                asyncResponse.resume(new RestException(ex.getCause()));
+            if (!isRedirectException(ex)) {
+                log.error("[{}] Failed to list topics on namespace bundle 
{}/{}", clientAppId(),
+                        namespaceName, bundleRange, ex);
             }
+            resumeAsyncResponseExceptionally(asyncResponse, ex);
             return null;
         });
     }

Reply via email to