codelipenghui commented on code in PR #25284:
URL: https://github.com/apache/pulsar/pull/25284#discussion_r2885668483
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:
##########
@@ -93,11 +93,10 @@ public class ClustersBase extends AdminResource {
})
public void getClusters(@Suspended AsyncResponse asyncResponse) {
clusterResources().listAsync()
- .thenApply(clusters -> clusters.stream()
+ .thenAcceptAsync(clusters ->
asyncResponse.resume(clusters.stream()
// Remove "global" cluster from returned list
.filter(cluster ->
!Constants.GLOBAL_CLUSTER.equals(cluster))
- .collect(Collectors.toSet()))
- .thenAccept(asyncResponse::resume)
+ .collect(Collectors.toSet())),
pulsar().getWebService().getWebServiceExecutor())
.exceptionally(ex -> {
log.error("[{}] Failed to get clusters {}", clientAppId(),
ex);
resumeAsyncResponseExceptionally(asyncResponse, ex);
Review Comment:
Do we also need to use handleAsync for the exceptional path?
--
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]