[jira] [Commented] (ARTEMIS-2140) AMQP Shared Subscriptions fail because of RaceCondition

2018-11-15 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-2140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16688575#comment-16688575
 ] 

ASF subversion and git services commented on ARTEMIS-2140:
--

Commit e334da322ea332be5e2bb7a32e8cd4a0d46eb1d6 in activemq-artemis's branch 
refs/heads/2.6.x from [~jbertram]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=e334da3 ]

ARTEMIS-2140 queue creation race w/AMQP shared subs

(cherry picked from commit e81453e6608ce70436576f1ed54b1f62d30ddc2e)


> AMQP Shared Subscriptions fail because of RaceCondition
> ---
>
> Key: ARTEMIS-2140
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2140
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: AMQP, Broker
>Affects Versions: 2.6.3
>Reporter: Johan Stenberg
>Assignee: Justin Bertram
>Priority: Major
> Fix For: 2.7.0, 2.6.4
>
> Attachments: Artemis2140_AmqpSharedConsumerRaceConditionTest.java
>
>
> When multiple clients concurrently try to subscribe to the same shared 
> subscription the following exception occurs:
> {noformat}
> Okt 19, 2018 4:25:21 PM 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler 
> dispatch
> WARN: AMQ119018: Binding already exists LocalQueueBinding 
> [address=topics.cat, queue=QueueImpl[name=nonDurable.MY_SUB, 
> postOffice=PostOfficeImpl 
> [server=ActiveMQServerImpl::serverUUID=cf020fcf-d3aa-11e8-ac61-54524514640f], 
> temp=false]@6425eba3, filter=null, name=nonDurable.MY_SUB, 
> clusterName=nonDurable.MY_SUBcf020fcf-d3aa-11e8-ac61-54524514640f]
> ActiveMQQueueExistsException[errorType=QUEUE_EXISTS message=AMQ119018: 
> Binding already exists LocalQueueBinding [address=topics.cat, 
> queue=QueueImpl[name=nonDurable.MY_SUB, postOffice=PostOfficeImpl 
> [server=ActiveMQServerImpl::serverUUID=cf020fcf-d3aa-11e8-ac61-54524514640f], 
> temp=false]@6425eba3, filter=null, name=nonDurable.MY_SUB, 
> clusterName=nonDurable.MY_SUBcf020fcf-d3aa-11e8-ac61-54524514640f]]
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.SimpleAddressManager.addBinding(SimpleAddressManager.java:85)
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.WildcardAddressManager.addBinding(WildcardAddressManager.java:90)
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl.addBinding(PostOfficeImpl.java:615)
>   at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createQueue(ActiveMQServerImpl.java:2818)
>   at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createQueue(ActiveMQServerImpl.java:1690)
>   at 
> org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createQueue(ServerSessionImpl.java:594)
>   at 
> org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createQueue(ServerSessionImpl.java:634)
>   at 
> org.apache.activemq.artemis.protocol.amqp.broker.AMQPSessionCallback.createSharedVolatileQueue(AMQPSessionCallback.java:283)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext.initialise(ProtonServerSenderContext.java:374)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext.addSender(AMQPSessionContext.java:168)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.remoteLinkOpened(AMQPConnectionContext.java:243)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.onRemoteOpen(AMQPConnectionContext.java:462)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.Events.dispatch(Events.java:68)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.dispatch(ProtonHandler.java:494)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.flush(ProtonHandler.java:307)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.inputBuffer(ProtonHandler.java:272)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.inputBuffer(AMQPConnectionContext.java:158)
>   at 
> org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:147)
>   at 
> org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:643)
>   at 
> org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:73)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
>   at 
> 

[jira] [Commented] (ARTEMIS-2140) AMQP Shared Subscriptions fail because of RaceCondition

2018-11-14 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-2140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16686751#comment-16686751
 ] 

ASF subversion and git services commented on ARTEMIS-2140:
--

Commit e81453e6608ce70436576f1ed54b1f62d30ddc2e in activemq-artemis's branch 
refs/heads/master from [~jbertram]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=e81453e ]

ARTEMIS-2140 queue creation race w/AMQP shared subs


> AMQP Shared Subscriptions fail because of RaceCondition
> ---
>
> Key: ARTEMIS-2140
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2140
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: AMQP, Broker
>Affects Versions: 2.6.3
>Reporter: Johan Stenberg
>Assignee: Justin Bertram
>Priority: Major
> Fix For: 2.7.0, 2.6.4
>
> Attachments: Artemis2140_AmqpSharedConsumerRaceConditionTest.java
>
>
> When multiple clients concurrently try to subscribe to the same shared 
> subscription the following exception occurs:
> {noformat}
> Okt 19, 2018 4:25:21 PM 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler 
> dispatch
> WARN: AMQ119018: Binding already exists LocalQueueBinding 
> [address=topics.cat, queue=QueueImpl[name=nonDurable.MY_SUB, 
> postOffice=PostOfficeImpl 
> [server=ActiveMQServerImpl::serverUUID=cf020fcf-d3aa-11e8-ac61-54524514640f], 
> temp=false]@6425eba3, filter=null, name=nonDurable.MY_SUB, 
> clusterName=nonDurable.MY_SUBcf020fcf-d3aa-11e8-ac61-54524514640f]
> ActiveMQQueueExistsException[errorType=QUEUE_EXISTS message=AMQ119018: 
> Binding already exists LocalQueueBinding [address=topics.cat, 
> queue=QueueImpl[name=nonDurable.MY_SUB, postOffice=PostOfficeImpl 
> [server=ActiveMQServerImpl::serverUUID=cf020fcf-d3aa-11e8-ac61-54524514640f], 
> temp=false]@6425eba3, filter=null, name=nonDurable.MY_SUB, 
> clusterName=nonDurable.MY_SUBcf020fcf-d3aa-11e8-ac61-54524514640f]]
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.SimpleAddressManager.addBinding(SimpleAddressManager.java:85)
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.WildcardAddressManager.addBinding(WildcardAddressManager.java:90)
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl.addBinding(PostOfficeImpl.java:615)
>   at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createQueue(ActiveMQServerImpl.java:2818)
>   at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createQueue(ActiveMQServerImpl.java:1690)
>   at 
> org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createQueue(ServerSessionImpl.java:594)
>   at 
> org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createQueue(ServerSessionImpl.java:634)
>   at 
> org.apache.activemq.artemis.protocol.amqp.broker.AMQPSessionCallback.createSharedVolatileQueue(AMQPSessionCallback.java:283)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext.initialise(ProtonServerSenderContext.java:374)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext.addSender(AMQPSessionContext.java:168)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.remoteLinkOpened(AMQPConnectionContext.java:243)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.onRemoteOpen(AMQPConnectionContext.java:462)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.Events.dispatch(Events.java:68)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.dispatch(ProtonHandler.java:494)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.flush(ProtonHandler.java:307)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.inputBuffer(ProtonHandler.java:272)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.inputBuffer(AMQPConnectionContext.java:158)
>   at 
> org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:147)
>   at 
> org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:643)
>   at 
> org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:73)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
>   at 
> 

[jira] [Commented] (ARTEMIS-2140) AMQP Shared Subscriptions fail because of RaceCondition

2018-11-14 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-2140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16686752#comment-16686752
 ] 

ASF GitHub Bot commented on ARTEMIS-2140:
-

Github user asfgit closed the pull request at:

https://github.com/apache/activemq-artemis/pull/2426


> AMQP Shared Subscriptions fail because of RaceCondition
> ---
>
> Key: ARTEMIS-2140
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2140
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: AMQP, Broker
>Affects Versions: 2.6.3
>Reporter: Johan Stenberg
>Assignee: Justin Bertram
>Priority: Major
> Fix For: 2.7.0, 2.6.4
>
> Attachments: Artemis2140_AmqpSharedConsumerRaceConditionTest.java
>
>
> When multiple clients concurrently try to subscribe to the same shared 
> subscription the following exception occurs:
> {noformat}
> Okt 19, 2018 4:25:21 PM 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler 
> dispatch
> WARN: AMQ119018: Binding already exists LocalQueueBinding 
> [address=topics.cat, queue=QueueImpl[name=nonDurable.MY_SUB, 
> postOffice=PostOfficeImpl 
> [server=ActiveMQServerImpl::serverUUID=cf020fcf-d3aa-11e8-ac61-54524514640f], 
> temp=false]@6425eba3, filter=null, name=nonDurable.MY_SUB, 
> clusterName=nonDurable.MY_SUBcf020fcf-d3aa-11e8-ac61-54524514640f]
> ActiveMQQueueExistsException[errorType=QUEUE_EXISTS message=AMQ119018: 
> Binding already exists LocalQueueBinding [address=topics.cat, 
> queue=QueueImpl[name=nonDurable.MY_SUB, postOffice=PostOfficeImpl 
> [server=ActiveMQServerImpl::serverUUID=cf020fcf-d3aa-11e8-ac61-54524514640f], 
> temp=false]@6425eba3, filter=null, name=nonDurable.MY_SUB, 
> clusterName=nonDurable.MY_SUBcf020fcf-d3aa-11e8-ac61-54524514640f]]
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.SimpleAddressManager.addBinding(SimpleAddressManager.java:85)
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.WildcardAddressManager.addBinding(WildcardAddressManager.java:90)
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl.addBinding(PostOfficeImpl.java:615)
>   at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createQueue(ActiveMQServerImpl.java:2818)
>   at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createQueue(ActiveMQServerImpl.java:1690)
>   at 
> org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createQueue(ServerSessionImpl.java:594)
>   at 
> org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createQueue(ServerSessionImpl.java:634)
>   at 
> org.apache.activemq.artemis.protocol.amqp.broker.AMQPSessionCallback.createSharedVolatileQueue(AMQPSessionCallback.java:283)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext.initialise(ProtonServerSenderContext.java:374)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext.addSender(AMQPSessionContext.java:168)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.remoteLinkOpened(AMQPConnectionContext.java:243)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.onRemoteOpen(AMQPConnectionContext.java:462)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.Events.dispatch(Events.java:68)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.dispatch(ProtonHandler.java:494)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.flush(ProtonHandler.java:307)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.inputBuffer(ProtonHandler.java:272)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.inputBuffer(AMQPConnectionContext.java:158)
>   at 
> org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:147)
>   at 
> org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:643)
>   at 
> org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:73)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
>   at 
> io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
>   at 
> 

[jira] [Commented] (ARTEMIS-2140) AMQP Shared Subscriptions fail because of RaceCondition

2018-11-09 Thread Justin Bertram (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-2140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16681742#comment-16681742
 ] 

Justin Bertram commented on ARTEMIS-2140:
-

[~johan1], thanks for the test.  I incorporated it into my PR.

> AMQP Shared Subscriptions fail because of RaceCondition
> ---
>
> Key: ARTEMIS-2140
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2140
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: AMQP, Broker
>Affects Versions: 2.6.3
>Reporter: Johan Stenberg
>Priority: Major
> Attachments: Artemis2140_AmqpSharedConsumerRaceConditionTest.java
>
>
> When multiple clients concurrently try to subscribe to the same shared 
> subscription the following exception occurs:
> {noformat}
> Okt 19, 2018 4:25:21 PM 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler 
> dispatch
> WARN: AMQ119018: Binding already exists LocalQueueBinding 
> [address=topics.cat, queue=QueueImpl[name=nonDurable.MY_SUB, 
> postOffice=PostOfficeImpl 
> [server=ActiveMQServerImpl::serverUUID=cf020fcf-d3aa-11e8-ac61-54524514640f], 
> temp=false]@6425eba3, filter=null, name=nonDurable.MY_SUB, 
> clusterName=nonDurable.MY_SUBcf020fcf-d3aa-11e8-ac61-54524514640f]
> ActiveMQQueueExistsException[errorType=QUEUE_EXISTS message=AMQ119018: 
> Binding already exists LocalQueueBinding [address=topics.cat, 
> queue=QueueImpl[name=nonDurable.MY_SUB, postOffice=PostOfficeImpl 
> [server=ActiveMQServerImpl::serverUUID=cf020fcf-d3aa-11e8-ac61-54524514640f], 
> temp=false]@6425eba3, filter=null, name=nonDurable.MY_SUB, 
> clusterName=nonDurable.MY_SUBcf020fcf-d3aa-11e8-ac61-54524514640f]]
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.SimpleAddressManager.addBinding(SimpleAddressManager.java:85)
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.WildcardAddressManager.addBinding(WildcardAddressManager.java:90)
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl.addBinding(PostOfficeImpl.java:615)
>   at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createQueue(ActiveMQServerImpl.java:2818)
>   at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createQueue(ActiveMQServerImpl.java:1690)
>   at 
> org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createQueue(ServerSessionImpl.java:594)
>   at 
> org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createQueue(ServerSessionImpl.java:634)
>   at 
> org.apache.activemq.artemis.protocol.amqp.broker.AMQPSessionCallback.createSharedVolatileQueue(AMQPSessionCallback.java:283)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext.initialise(ProtonServerSenderContext.java:374)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext.addSender(AMQPSessionContext.java:168)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.remoteLinkOpened(AMQPConnectionContext.java:243)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.onRemoteOpen(AMQPConnectionContext.java:462)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.Events.dispatch(Events.java:68)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.dispatch(ProtonHandler.java:494)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.flush(ProtonHandler.java:307)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.inputBuffer(ProtonHandler.java:272)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.inputBuffer(AMQPConnectionContext.java:158)
>   at 
> org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:147)
>   at 
> org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:643)
>   at 
> org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:73)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
>   at 
> io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
>   at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>   at 
> 

[jira] [Commented] (ARTEMIS-2140) AMQP Shared Subscriptions fail because of RaceCondition

2018-11-09 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-2140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16681740#comment-16681740
 ] 

ASF GitHub Bot commented on ARTEMIS-2140:
-

GitHub user jbertram opened a pull request:

https://github.com/apache/activemq-artemis/pull/2426

ARTEMIS-2140 queue creation race w/AMQP shared subs



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jbertram/activemq-artemis ARTEMIS-2140

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/activemq-artemis/pull/2426.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2426


commit 6aae49b0ea9873790a0cd76bb87047d71ad93d30
Author: Justin Bertram 
Date:   2018-11-09T17:38:28Z

ARTEMIS-2140 queue creation race w/AMQP shared subs




> AMQP Shared Subscriptions fail because of RaceCondition
> ---
>
> Key: ARTEMIS-2140
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2140
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: AMQP, Broker
>Affects Versions: 2.6.3
>Reporter: Johan Stenberg
>Priority: Major
> Attachments: Artemis2140_AmqpSharedConsumerRaceConditionTest.java
>
>
> When multiple clients concurrently try to subscribe to the same shared 
> subscription the following exception occurs:
> {noformat}
> Okt 19, 2018 4:25:21 PM 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler 
> dispatch
> WARN: AMQ119018: Binding already exists LocalQueueBinding 
> [address=topics.cat, queue=QueueImpl[name=nonDurable.MY_SUB, 
> postOffice=PostOfficeImpl 
> [server=ActiveMQServerImpl::serverUUID=cf020fcf-d3aa-11e8-ac61-54524514640f], 
> temp=false]@6425eba3, filter=null, name=nonDurable.MY_SUB, 
> clusterName=nonDurable.MY_SUBcf020fcf-d3aa-11e8-ac61-54524514640f]
> ActiveMQQueueExistsException[errorType=QUEUE_EXISTS message=AMQ119018: 
> Binding already exists LocalQueueBinding [address=topics.cat, 
> queue=QueueImpl[name=nonDurable.MY_SUB, postOffice=PostOfficeImpl 
> [server=ActiveMQServerImpl::serverUUID=cf020fcf-d3aa-11e8-ac61-54524514640f], 
> temp=false]@6425eba3, filter=null, name=nonDurable.MY_SUB, 
> clusterName=nonDurable.MY_SUBcf020fcf-d3aa-11e8-ac61-54524514640f]]
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.SimpleAddressManager.addBinding(SimpleAddressManager.java:85)
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.WildcardAddressManager.addBinding(WildcardAddressManager.java:90)
>   at 
> org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl.addBinding(PostOfficeImpl.java:615)
>   at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createQueue(ActiveMQServerImpl.java:2818)
>   at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createQueue(ActiveMQServerImpl.java:1690)
>   at 
> org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createQueue(ServerSessionImpl.java:594)
>   at 
> org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createQueue(ServerSessionImpl.java:634)
>   at 
> org.apache.activemq.artemis.protocol.amqp.broker.AMQPSessionCallback.createSharedVolatileQueue(AMQPSessionCallback.java:283)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext.initialise(ProtonServerSenderContext.java:374)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext.addSender(AMQPSessionContext.java:168)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.remoteLinkOpened(AMQPConnectionContext.java:243)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.onRemoteOpen(AMQPConnectionContext.java:462)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.Events.dispatch(Events.java:68)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.dispatch(ProtonHandler.java:494)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.flush(ProtonHandler.java:307)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.inputBuffer(ProtonHandler.java:272)
>   at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.inputBuffer(AMQPConnectionContext.java:158)
>   at 
> org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:147)
>   at 
> org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:643)
>   at 
>