[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-09-18 Thread Robbie Gemmell (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12911080#action_12911080
 ] 

Robbie Gemmell commented on QPID-2418:
--

As per Andrews earlier comments, the updates do not fully resolve the issue 
when using 0-8/0-9/0-9-1 clients as the information on previous subscribers is 
only held per-session, and regardless of this it is not possible with these 
protocol versions to determine when connecting whether any existing server side 
selector (if any) matches the new one (if any) as the arguments can not be 
queried. It is only possible to tell from the queue bindings whether the Topic 
in use differs differs.

The updates I made to augment the original patch do allow the 0-10 client to 
determine that the selector is changing even without knowledge of any prior 
subscribers on the session and so should fully resolve the issue. This was 
achieved by always sending the selector argument but giving it an empty value 
if no selector is in use (the broker interprets the empty argument as lack of a 
selector just as it would if the argument was not present), as this allows 
querying the broker upon (re)connection whether the selector argument matches 
any existing argument. Additionally, the client side selectors in the 0-10 
client would already protect from reciept of messages which do not match the 
selector in use at any given point.

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch, 
> QPID-2418-trunk_new.patch, QPID-2418-trunk_robbies_additions.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-09-05 Thread Robbie Gemmell (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906366#action_12906366
 ] 

Robbie Gemmell commented on QPID-2418:
--

Original patch updated (QPID-2418-trunk_new.patch) and applied to trunk, and 
modifications added to enable the tests to pass on all profiles.

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch, 
> QPID-2418-trunk_new.patch, QPID-2418-trunk_robbies_additions.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-08-05 Thread Robbie Gemmell (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895645#action_12895645
 ] 

Robbie Gemmell commented on QPID-2418:
--

The patch has definitely rotted a bit and needs updating, plus i think the 
tests still need updated to account for the difference in queue behaviour 
between brokers when selectors are used (and also, the 0-10 java client not 
currently sending the server side selector argument to the Java broker too I 
think ), but Andrew or myself will get to this some time soon.

Robbie.

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-08-04 Thread Rajith Attapattu (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895380#action_12895380
 ] 

Rajith Attapattu commented on QPID-2418:


Robbie,

I believe you put this on hold based on a request from me.
Sorry for not following up with you on this.

Would you like to go ahead and commit this patch now?

Regards,

Rajith

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-04-02 Thread Robbie Gemmell (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852820#action_12852820
 ] 

Robbie Gemmell commented on QPID-2418:
--

At some point next week.

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-04-02 Thread Rajith Attapattu (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852805#action_12852805
 ] 

Rajith Attapattu commented on QPID-2418:


Robbie,

When are you planning to apply the trunk patch?

Rajith



>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-04-02 Thread Robbie Gemmell (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852747#action_12852747
 ] 

Robbie Gemmell commented on QPID-2418:
--

Applied patch to the branch only.

Trunk patch still needs to be reviewed and applied.

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-03-31 Thread Rajith Attapattu (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852046#action_12852046
 ] 

Rajith Attapattu commented on QPID-2418:


Interesting, the queue declare with the new selector merely updates the the 
selector on the queue?
The AMQP spec doesn't really define the behaviour if a queue declare is sent 
with the same name but different args (in this case the selector).
So I wouldn't argue that the Java broker is wrong. The c++ client merely 
ignores the queue declare.
IMO I think both brokers are wrong as this can lead to subtle errors that can 
go undetected -  but thats separate topic all together.

So on the C++ side, the queue is not deleted due to the java client bug. 
So the message is there and gets sent to the client who now has a new selector 
(with 0-10 client side selectors) which matches and the message is delivered.

Anyways once we fix the Java client to issue a queue this should be taken care 
of.
Always a good idea to run the default java and c++ profiles before an update.

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-03-31 Thread Robbie Gemmell (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852032#action_12852032
 ] 

Robbie Gemmell commented on QPID-2418:
--

The changes made to DurableSubscriptionTest were not intended to yet expose 
this bug any more than it was, and were deliberately kept short so that they 
wouldnt (the comment is innacurate youll note, as it isnt doing what it was 
originally and I forgot to update that). The new test added in 
DurableSubscriberTest that absolutely would expose it was excluded until it is 
fixed so that automated builds wouldnt be been broken. What I didnt do was run 
the test using the C++ broker as I didnt think I was changing anything of any 
particular note, but I failed to consider that it could behave slightly 
differently due to use of client side selectors rather than the server side 
selectors used by the Java broker. The broker doenst create a new queue, but it 
does change the filters used to select messages meaning that messges never get 
onto the queue which will on the C++ broker, which I imagine is where the test 
now fails. I'll take that into account when updating it.

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-03-31 Thread Rajith Attapattu (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851997#action_12851997
 ] 

Rajith Attapattu commented on QPID-2418:


When investigating the test failure for "testResubscribeWithChangedSelector" in 
the DurableSubscriptionTest, I was a bit shocked to see the amount of code 
duplication.
This may have been due to a merge, but we definitely need to fix this. So thx 
for taking care of this.

I haven't had chance to have a closer look at the patches, but please make sure 
tests pass against both the C++ and Java Broker before committing it.

Also the change made in rev 929095 to the DurableSubscriptionTest.java (method 
testResubscribeWithChangedSelector) is somehow passing for the Java broker.
Bcos we have the bug mentioned in this bug, it should be failing in both 
brokers.
I am not so happy about checking in the change to the test case before a fix is 
committed as this has broken our automated builds.

Perhaps the Java broker is creating a new queue as the arguments list is 
different (the selector being different) ?
Isn't that a bug? Perhaps worthwhile investigating this.

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-03-31 Thread Robbie Gemmell (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851830#action_12851830
 ] 

Robbie Gemmell commented on QPID-2418:
--

On line 1086 (after patching) this code segment needs updated: 
   if (_subscriptionTopics.containsKey(name) && 
_subscriptionSelectors.containsKey(name))
{
if (!_subscriptionTopics.get(name).equals(topic) || 
!_subscriptionSelectors.get(name).equals(messageSelector))
{
_logger.info("Unsubscribing from topic " + topic + " with 
subscription exchange " + name
+ " and selector " + messageSelector);
unsubscribe(name);
}
}

If the subscription name has been seen before but used without a selector, then 
in the outer if statement the first test will success but the second will fail, 
causing the inner if statement to detect subscription change not to be 
evaluated. However, if the new subscription with reused name happens to be 
adding a selector then this should be classified as a selector change (from no 
selector) and cause unsubscription before proceeding.

Also, there is possibility of deadlock when creation of a new durable 
subscriber occurs with the same subscription name as an existing open 
subscriber, which will cause unsubscribe+closure of the old subscriber. The 
create method will hold the new lock added, but closing the subscription will 
contact the broker, which will reply and then a different thread will execute 
the returned BasicCancelOK method and try to aquire the lock in 
deregisterConsumer() in order to complete the closure, causing the first thread 
executing the close to timeout and throw an exception. Looking at the map 
usages it seems there is actually no need to acquire the same lock in 
deregisterConsumer(), only a need to govern access to the subscriptions and 
reverseSubscriptionMaps, which could be achieved using a second lock that 
doesnt encompass the subscriber.close() operation.

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 0001-QPID-2418-branch.patch, 0001-QPID-2418-trunk.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org



[jira] Commented: (QPID-2418) Existing durable subscription with selector is not unsubscribed during change to new subscription

2010-03-26 Thread Robbie Gemmell (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850103#action_12850103
 ] 

Robbie Gemmell commented on QPID-2418:
--

The approach taken in the patch looks good, but I spotted some issues wih it 
that need addressed, and an opportunity to get rid of a lot of [pre-existing] 
duplication:


The unsubscribe method synchronises around the _subscriptions map, but nothing 
else appears to. The content in the various maps within the block are 
accessed/updated from a few other locations (in AMQsession, and its 0_8 and 
0_10 subclasses), and the content in multiple maps is generally directly 
related (eg subscriptions and reverse subscriptions maps, and the topics and 
selectors maps) so there could still be threading issues despite the 
synchorized block in unsubscribe. The various other uses of the maps should 
also be protected to ensure the associated information in the multiple maps 
they access/update is properly matched.

When a new durable subscription is made without a selector, it should also 
check if any known existing/previous subscription using the same name DID have 
a selector, and if so should both unsubscribe the subscription name _and_ 
remove the existing selector from the selectors map.

In AMQSession.createDurableSubscriber(Topic topic, String name, String 
messageSelector, boolean noLocal), when removing an entry from the 
reverseSubscriptionsMap the subscription is given as the key. It should 
actually be the parent Consumer which is provided as the key. The same applies 
in the unsubscribe method (existing bug).

When adding the selector to the subscriptionSelectors map the value is not 
permitted to be null, but the selector value is not checked before adding it. 
The value can quite easily be null here, as although it is retrieved from the 
consumer object it is the same String that is passed into the create method, 
meaning it can be provided null and is actually set to null in the method 
itself if the selector string given 'isBlank'.

A small update was made in the AMQSession_0_8 and 0_10 subclasses. Examining 
the almost-identical methods more closesly seems to show that although they 
look to do slightly different things and call differnet methods to achieve 
their result, they do infact ultimately end up doing exactly the same thing. 
These methods (and those they call) should be rationalised and the 
createDurableSubscriber(Topic, String) method implementation moved into the 
abstract superclass with the comparible selector method variant which already 
resides there (those 2 methods can then potentially be reduced to a common 
implementation too).

>  Existing durable subscription with selector is not unsubscribed during 
> change to new subscription
> --
>
> Key: QPID-2418
> URL: https://issues.apache.org/jira/browse/QPID-2418
> Project: Qpid
>  Issue Type: Bug
>  Components: Java Client
>Affects Versions: M4, 0.5, 0.6
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
> Fix For: 0.7
>
> Attachments: 
> 0001-QPID-2418-Unsubscribe-existing-durable-subscription.patch
>
>
> AMQSession.createDurableSubscriber(topic, name, messageSelector, noLocal) 
> does not unsubscribe existing durable subscriptions. Whilst it does check for 
> existing durable subscriptions in use by the client with the same name, it 
> instead simply closes the subscriptions then creates a new one. As a result 
> of not unsubscribing, the queue backing the subscription is not deleted 
> before being used by the updated subscription as it should be (and as happens 
> in the 0_8 and 0_10 subclasses when using durable subscriptions without 
> selectors).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
Apache Qpid - AMQP Messaging Implementation
Project:  http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org