You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2020/07/06 07:36:18 UTC

[pulsar] branch master updated: Add more detail information of retry errors (#7341)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new f4547ec  Add more detail information of retry errors (#7341)
f4547ec is described below

commit f4547ecfe37c6752251699aadf8c19b380f42bc9
Author: Yong Zhang <zh...@gmail.com>
AuthorDate: Mon Jul 6 15:36:02 2020 +0800

    Add more detail information of retry errors (#7341)
    
    ---
    
    *Motivation*
    
    Currently, when you connecting to a wrong address, the error
    log does not show the detail information to let you know why
    it failed. Add the failed reason to know more about the error.
    
    Before adding the error log:
    
    ```
    bin/pulsar-admin topics list public/default
    null
    
    Reason: java.util.concurrent.CompletionException: org.apache.pulsar.client.admin.internal.http.AsyncHttpConnector$RetryException: Could not complete the operation. Number of retries has been exhausted.
    ```
    
    After adding the error log:
    
    ```
    bin/pulsar-admin topics list public/default
    null
    
    Reason: java.util.concurrent.CompletionException: org.apache.pulsar.client.admin.internal.http.AsyncHttpConnector$RetryException: Could not complete the operation. Number of retries has been exhausted.Connection refused: localhost/127.0.0.1:8081
    ```
---
 .../apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java
index eca1800..c0dc467 100644
--- a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java
+++ b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java
@@ -240,8 +240,9 @@ public class AsyncHttpConnector implements Connector {
                                             retries - 1);
                                 } else {
                                     resultFuture.completeExceptionally(
-                                            new RetryException("Could not complete the operation. Number of retries "
-                                            + "has been exhausted.", throwable));
+                                        new RetryException("Could not complete the operation. Number of retries "
+                                            + "has been exhausted. Failed reason: " + throwable.getMessage(),
+                                            throwable));
                                 }
                             }
                         } else {