This is an automated email from the ASF dual-hosted git repository. mmerli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git
The following commit(s) were added to refs/heads/master by this push: new 18dc1c8 Fix: deadlock while closing non-persistent topic (#1660) 18dc1c8 is described below commit 18dc1c87f3217766453600ba849e82625ee73086 Author: Rajan Dhabalia <rdhaba...@apache.org> AuthorDate: Fri Apr 27 11:29:37 2018 -0700 Fix: deadlock while closing non-persistent topic (#1660) --- .../pulsar/broker/service/nonpersistent/NonPersistentTopic.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java index ad0197c..1cc9403 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java @@ -489,8 +489,12 @@ public class NonPersistentTopic implements Topic { FutureUtil.waitForAll(futures).thenRun(() -> { log.info("[{}] Topic closed", topic); - brokerService.pulsar().getExecutor().execute(() -> brokerService.removeTopicFromCache(topic)); - closeFuture.complete(null); + // unload topic iterates over topics map and removing from the map with the same thread creates deadlock. + // so, execute it in different thread + brokerService.executor().execute(() -> { + brokerService.removeTopicFromCache(topic); + closeFuture.complete(null); + }); }).exceptionally(exception -> { log.error("[{}] Error closing topic", topic, exception); isFenced = false; -- To stop receiving notification emails like this one, please contact mme...@apache.org.