[improve][metadataStore] Update namespace policies would cause metadata-store thread waiting too long
@@ -2005,7 +2005,7 @@ public class BrokerService implements Closeable {
private void handleLocalPoliciesUpdates(NamespaceName namespace) {
pulsar.getPulsarResources().getLocalPolicies().getLocalPoliciesAsync(namespace)
- .thenAccept(optLocalPolicies -> {
+ .thenAcceptAsync(optLocalPolicies -> {
if (!optLocalPolicies.isPresent()) {
return;
}
@@ -2028,12 +2028,12 @@ public class BrokerService implements Closeable {
});
}
});
- });
+ }, pulsar.getExecutor());
}
private void handlePoliciesUpdates(NamespaceName namespace) {
pulsar.getPulsarResources().getNamespaceResources().getPoliciesAsync(namespace)
- .thenAccept(optPolicies -> {
+ .thenAcceptAsync(optPolicies -> {
if (!optPolicies.isPresent()) {
return;
}
@@ -2058,7 +2058,7 @@ public class BrokerService implements Closeable {
// sometimes, some brokers don't receive policies-update watch and miss to remove
// replication-cluster and still own the bundle. That can cause data-loss for TODO: git-issue
unloadDeletedReplNamespace(policies, namespace);
- });
+ }, pulsar.getExecutor());
}
private void handleDynamicConfigurationUpdates() {
