From 81d9c74d6f53a595042cbc273e630cd71d93b7e4 Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Mon, 9 Apr 2018 08:28:44 -0500 Subject: [PATCH] ARTEMIS-1792 race in STOMP unsubscribe --- .../activemq/artemis/core/protocol/stomp/StompConnection.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java index baaa36e03b..32e64b3f9b 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java @@ -25,6 +25,7 @@ import java.util.StringTokenizer; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ScheduledExecutorService; +import org.apache.activemq.artemis.api.core.ActiveMQAddressDoesNotExistException; import org.apache.activemq.artemis.api.core.ActiveMQBuffer; import org.apache.activemq.artemis.api.core.ActiveMQBuffers; import org.apache.activemq.artemis.api.core.ActiveMQException; @@ -706,6 +707,8 @@ public final class StompConnection implements RemotingConnection { public void unsubscribe(String subscriptionID, String durableSubscriptionName) throws ActiveMQStompException { try { manager.unsubscribe(this, subscriptionID, durableSubscriptionName); + } catch (ActiveMQAddressDoesNotExistException e) { + // this could happen if multiple clients unsubscribe simultaneously and auto-delete-addresses = true } catch (ActiveMQStompException e) { throw e; } catch (Exception e) {