ARTEMIS-1792 race in STOMP unsubscribe

This commit is contained in:
Justin Bertram 2018-04-09 08:28:44 -05:00 committed by Howard Gao
parent b3d781daa2
commit 81d9c74d6f
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import java.util.StringTokenizer;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledExecutorService; 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.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.ActiveMQBuffers; import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
import org.apache.activemq.artemis.api.core.ActiveMQException; 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 { public void unsubscribe(String subscriptionID, String durableSubscriptionName) throws ActiveMQStompException {
try { try {
manager.unsubscribe(this, subscriptionID, durableSubscriptionName); manager.unsubscribe(this, subscriptionID, durableSubscriptionName);
} catch (ActiveMQAddressDoesNotExistException e) {
// this could happen if multiple clients unsubscribe simultaneously and auto-delete-addresses = true
} catch (ActiveMQStompException e) { } catch (ActiveMQStompException e) {
throw e; throw e;
} catch (Exception e) { } catch (Exception e) {