Skip to content

Commit 9dcc3b9

Browse files
committed
feat(broker): fix ExtensibleLoadManagerImplTest.testDisableBroker
1 parent 8f995b2 commit 9dcc3b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,10 @@ private CompletableFuture<Optional<String>> getActiveOwnerAsync(
460460
String serviceUnit,
461461
ServiceUnitState state,
462462
Optional<String> owner) {
463-
463+
// If the channel is disabled or closed, this broker cannot be an active owner.
464+
if (channelState == Disabled || channelState == Closed) {
465+
return CompletableFuture.completedFuture(Optional.empty());
466+
}
464467
// If this broker's registry does not exist(possibly suffering from connecting to the metadata store),
465468
// we return the owner without its activeness check.
466469
// This broker tries to serve lookups on a best efforts basis when metadata store connection is unstable.

0 commit comments

Comments
 (0)