heesung-sn commented on code in PR #19945:
URL: https://github.com/apache/pulsar/pull/19945#discussion_r1155433458
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:
##########
@@ -474,16 +481,22 @@ public CompletableFuture<Optional<String>>
getOwnerAsync(String serviceUnit) {
return
CompletableFuture.completedFuture(Optional.of(data.sourceBroker()));
}
case Assigning, Releasing -> {
- return deferGetOwnerRequest(serviceUnit).thenApply(
+ return deferGetOwnerRequest(serviceUnit).whenComplete((__, e)
-> {
+ if (e != null) {
+
ownerLookUpCounters.get(state).failure.incrementAndGet();
+ }
+ }).thenApply(
broker -> broker == null ? Optional.empty() :
Optional.of(broker));
}
case Init, Free -> {
return CompletableFuture.completedFuture(Optional.empty());
}
case Deleted -> {
+ ownerLookUpCounters.get(state).failure.incrementAndGet();
Review Comment:
updated.
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:
##########
@@ -474,16 +481,22 @@ public CompletableFuture<Optional<String>>
getOwnerAsync(String serviceUnit) {
return
CompletableFuture.completedFuture(Optional.of(data.sourceBroker()));
}
case Assigning, Releasing -> {
- return deferGetOwnerRequest(serviceUnit).thenApply(
+ return deferGetOwnerRequest(serviceUnit).whenComplete((__, e)
-> {
+ if (e != null) {
+
ownerLookUpCounters.get(state).failure.incrementAndGet();
+ }
+ }).thenApply(
broker -> broker == null ? Optional.empty() :
Optional.of(broker));
}
case Init, Free -> {
return CompletableFuture.completedFuture(Optional.empty());
}
case Deleted -> {
+ ownerLookUpCounters.get(state).failure.incrementAndGet();
return CompletableFuture.failedFuture(new
IllegalArgumentException(serviceUnit + " is deleted."));
}
default -> {
+ ownerLookUpCounters.get(state).failure.incrementAndGet();
Review Comment:
updated.
--
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]