Technoboy- commented on a change in pull request #14055:
URL: https://github.com/apache/pulsar/pull/14055#discussion_r801665160



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java
##########
@@ -116,21 +111,15 @@ public void getActiveBrokers(@Suspended final 
AsyncResponse asyncResponse,
                     @ApiResponse(code = 403, message = "This operation 
requires super-user access"),
                     @ApiResponse(code = 404, message = "Leader broker not 
found") })
     public void getLeaderBroker(@Suspended final AsyncResponse asyncResponse) {
-        validateSuperUserAccessAsync().thenAccept(__ -> {
+        validateSuperUserAccessAsync()
+                .thenAccept(__ -> {
                     LeaderBroker leaderBroker = 
pulsar().getLeaderElectionService().getCurrentLeader()
                             .orElseThrow(() -> new 
RestException(Status.NOT_FOUND, "Couldn't find leader broker"));
-                    BrokerInfo brokerInfo = 
BrokerInfo.builder().serviceUrl(leaderBroker.getServiceUrl()).build();
-                    asyncResponse.resume(brokerInfo);
-                })
-                .exceptionally(ex -> {
-                    Throwable realCause = 
FutureUtil.unwrapCompletionException(ex);
-                    LOG.error("[{}] Failed to get the information of the 
leader broker.", clientAppId(), realCause);
-                    if (realCause instanceof WebApplicationException) {
-                        asyncResponse.resume(realCause);
-                    } else {
-                        asyncResponse.resume(new RestException(realCause));
-                    }
-                    return null;
+                    log.info("[{}] Successfully to get the information of the 
leader broker.", clientAppId());

Review comment:
       Add additional log, right ?
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to