From 7d317bd3c325ffcfea17fd92c88cfe9a5b52ece1 Mon Sep 17 00:00:00 2001 From: Raj Date: Thu, 22 Sep 2016 09:48:34 -0700 Subject: [PATCH] While closing-topic: remove producer from set in separate thread than same set-iterator thread (#32) --- .../main/java/com/yahoo/pulsar/broker/service/Producer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pulsar-broker/src/main/java/com/yahoo/pulsar/broker/service/Producer.java b/pulsar-broker/src/main/java/com/yahoo/pulsar/broker/service/Producer.java index 65136763380c4..ffa1607275b49 100644 --- a/pulsar-broker/src/main/java/com/yahoo/pulsar/broker/service/Producer.java +++ b/pulsar-broker/src/main/java/com/yahoo/pulsar/broker/service/Producer.java @@ -328,8 +328,10 @@ void closeNow() { public CompletableFuture disconnect() { if (!closeFuture.isDone()) { log.info("Disconnecting producer: {}", this); - cnx.closeProducer(this); - closeNow(); + cnx.ctx().executor().execute(() -> { + cnx.closeProducer(this); + closeNow(); + }); } return closeFuture; }