This is an automated email from the ASF dual-hosted git repository.
jerrypeng 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 5b0214a [Issue 12929] [pulsar-metadata] Fix metadata store deadlock
(#12930)
5b0214a is described below
commit 5b0214a196e3de5a44d1e772b1b65bd720296727
Author: Bharani Chadalavada <[email protected]>
AuthorDate: Mon Dec 6 14:41:17 2021 -0800
[Issue 12929] [pulsar-metadata] Fix metadata store deadlock (#12930)
* replace thenAccept with thenAcceptAsync to avoid deadlock.
* Use pulsar executor.
Co-authored-by: Bharani Chadalavada <[email protected]>
---
.../org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
index d053d14..3866757 100644
---
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
+++
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
@@ -1434,7 +1434,7 @@ public class PersistentTopicsBase extends AdminResource {
internalDeleteSubscriptionForNonPartitionedTopic(asyncResponse,
subName, authoritative);
} else {
getPartitionedTopicMetadataAsync(topicName,
- authoritative, false).thenAccept(partitionMetadata -> {
+ authoritative, false).thenAcceptAsync(partitionMetadata ->
{
if (partitionMetadata.partitions > 0) {
final List<CompletableFuture<Void>> futures =
Lists.newArrayList();
@@ -1476,7 +1476,7 @@ public class PersistentTopicsBase extends AdminResource {
} else {
internalDeleteSubscriptionForNonPartitionedTopic(asyncResponse, subName,
authoritative);
}
- }).exceptionally(ex -> {
+ }, pulsar().getExecutor()).exceptionally(ex -> {
log.error("[{}] Failed to delete subscription {} from topic
{}",
clientAppId(), subName, topicName, ex);
resumeAsyncResponseExceptionally(asyncResponse, ex);