Avoid using ``Completable#join`` long wait for results.
@@ -356,7 +356,8 @@ public class ModularLoadManagerImpl implements ModularLoadManager {
@Override
public Set<String> getAvailableBrokers() {
try {
- return new HashSet<>(brokersData.listLocks(LoadManager.LOADBALANCE_BROKERS_ROOT).join());
+ return new HashSet<>(brokersData.listLocks(LoadManager.LOADBALANCE_BROKERS_ROOT)
+ .get(conf.getMetadataStoreOperationTimeoutSeconds(), TimeUnit.SECONDS));
} catch (Exception e) {
log.warn("Error when trying to get active brokers", e);
return loadData.getBrokerData().keySet();
