This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new b3c51485d1a [fix][cli] Fix some pulsar-admin topicPolicies commands
exiting before async operations complete (#25051)
b3c51485d1a is described below
commit b3c51485d1a15562d700a3a592e072dbea457ec1
Author: fengyubiao <[email protected]>
AuthorDate: Wed Dec 10 16:14:11 2025 +0800
[fix][cli] Fix some pulsar-admin topicPolicies commands exiting before
async operations complete (#25051)
Co-authored-by: Jiwe Guo <[email protected]>
---
.../main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java
b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java
index c425d926b6c..73032791e2c 100644
---
a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java
+++
b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java
@@ -1959,7 +1959,7 @@ public class CmdTopicPolicies extends CmdBase {
@Override
void run() throws PulsarAdminException {
String persistentTopic = validatePersistentTopic(topicName);
-
getTopicPolicies(isGlobal).setDispatcherPauseOnAckStatePersistent(persistentTopic);
+ sync(() ->
getTopicPolicies(isGlobal).setDispatcherPauseOnAckStatePersistent(persistentTopic));
}
}
@@ -1978,7 +1978,8 @@ public class CmdTopicPolicies extends CmdBase {
@Override
void run() throws PulsarAdminException {
String persistentTopic = validatePersistentTopic(topicName);
-
print(getTopicPolicies(isGlobal).getDispatcherPauseOnAckStatePersistent(persistentTopic,
applied));
+ print(sync(() ->
+
(getTopicPolicies(isGlobal).getDispatcherPauseOnAckStatePersistent(persistentTopic,
applied))));
}
}
@@ -1994,7 +1995,7 @@ public class CmdTopicPolicies extends CmdBase {
@Override
void run() throws PulsarAdminException {
String persistentTopic = validatePersistentTopic(topicName);
-
getTopicPolicies(isGlobal).removeDispatcherPauseOnAckStatePersistent(persistentTopic);
+ sync(() ->
getTopicPolicies(isGlobal).removeDispatcherPauseOnAckStatePersistent(persistentTopic));
}
}
@@ -2019,7 +2020,7 @@ public class CmdTopicPolicies extends CmdBase {
void run() throws PulsarAdminException {
String persistentTopic = validatePersistentTopic(topicName);
List<String> clusters = Lists.newArrayList(clusterIds.split(","));
- getTopicPolicies(isGlobal).setReplicationClusters(persistentTopic,
clusters);
+ sync(() ->
getTopicPolicies(isGlobal).setReplicationClusters(persistentTopic, clusters));
}
}