Bug 997919 - subscribing a consumer to a queue using filter/selector causes already subscribed consumers to stop receiving messages
Summary: subscribing a consumer to a queue using filter/selector causes already subscr...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: Development
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 3.0
: ---
Assignee: Gordon Sim
QA Contact: Petr Matousek
URL:
Whiteboard:
Depends On:
Blocks: 1010399
TreeView+ depends on / blocked
 
Reported: 2013-08-16 13:46 UTC by Petr Matousek
Modified: 2015-01-21 12:56 UTC (History)
4 users (show)

Fixed In Version: qpid-cpp-0.22-12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-21 12:56:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-5078 0 None None None Never

Description Petr Matousek 2013-08-16 13:46:09 UTC
Description of problem:

Already subscribed consumer stops to receive messages when another subscription to the same queue with different subject is initiated. see 'Steps to Reproduce' for more details.

Version-Release number of selected component (if applicable):
qpid-cpp-*-0.22-11

How reproducible:
100%

Steps to Reproduce:
1. create a shared queue 'q'
# drain --connection-options "{ protocol: 'amqp1.0' }" "q;{create:always}"
2. subscribe a cosumer1 to queue 'q' using filter 'a'
# drain -f --connection-options "{ protocol: 'amqp1.0' }" q/a
3. send several messages to towards queue 'q' with subject set to 'a'
# for i in $(seq 5); do ./spout --connection-options "{ protocol: 'amqp1.0' }" q/a; done
4. all the messages consumed by consumer1 as expected
5. subscribe cosumer2 to queue 'q' using different filter 'b'
# drain -f --connection-options "{ protocol: 'amqp1.0' }" q/b
6. repeat step 3
7. the consumer1 obtains only one message, then he stops to receive messages
8. the consumer2 may normally receive messages sent towards queue 'q' with subject set to 'b'
# spout --connection-options "{ protocol: 'amqp1.0' }" q/b
9. after the consumer1 restart, the consumer1 gets the rest of the messages (that he didn't received in step 7)

Actual results:
subscribing a consumer to a queue using filter causes already subscribed consumer to stop receive messages

Expected results:
Already subscribed consumer continues to receive messages after another consumer is subscribed using different filter 

Additional info:

terminal1 - publisher:
# ./drain --connection-options "{ protocol: 'amqp1.0' }" "q;{create:always}"
-- consumer1 has subscribed here --
# for i in $(seq 5); do ./spout --connection-options "{ protocol: 'amqp1.0' }" q/a; done
-- consumer2 has subscribed here --
# for i in $(seq 5); do ./spout --connection-options "{ protocol: 'amqp1.0' }" q/a; done
# for i in $(seq 5); do ./spout --connection-options "{ protocol: 'amqp1.0' }" q/b; done
-- consumer1 restart --

terminal2 - consumer1:
# ./drain -f --connection-options "{ protocol: 'amqp1.0' }" q/a
Message(properties={spout-id:0e05ac1c-6bee-4966-b1af-89efda0e1883:0}, content='')
Message(properties={spout-id:0e05ac1c-6bee-4966-b1af-89efda0e1883:0}, content='')
Message(properties={spout-id:0e05ac1c-6bee-4966-b1af-89efda0e1883:0}, content='')
Message(properties={spout-id:0e05ac1c-6bee-4966-b1af-89efda0e1883:0}, content='')
Message(properties={spout-id:0e05ac1c-6bee-4966-b1af-89efda0e1883:0}, content='')
-- consumer2 has subscribed here --
Message(properties={spout-id:0e05ac1c-6bee-4966-b1af-89efda0e1883:0}, content='')
-- consumer1 stopped to receive messages --
^C
# ./drain -f --connection-options "{ protocol: 'amqp1.0' }" q/a
Message(properties={spout-id:8ba06f2f-89f2-4604-b7b5-d8b211e435cb:0}, content='')
Message(properties={spout-id:8ba06f2f-89f2-4604-b7b5-d8b211e435cb:0}, content='')
Message(properties={spout-id:8ba06f2f-89f2-4604-b7b5-d8b211e435cb:0}, content='')
Message(properties={spout-id:8ba06f2f-89f2-4604-b7b5-d8b211e435cb:0}, content='')

terminal3 - consumer2:
# ./drain -f --connection-options "{ protocol: 'amqp1.0' }" q/b
Message(properties={spout-id:f1e5dfcf-281d-47b7-b91e-9d086cf37523:0}, content='')
Message(properties={spout-id:f1e5dfcf-281d-47b7-b91e-9d086cf37523:0}, content='')
Message(properties={spout-id:f1e5dfcf-281d-47b7-b91e-9d086cf37523:0}, content='')
Message(properties={spout-id:f1e5dfcf-281d-47b7-b91e-9d086cf37523:0}, content='')
Message(properties={spout-id:f1e5dfcf-281d-47b7-b91e-9d086cf37523:0}, content='')

Comment 1 Gordon Sim 2013-08-16 17:14:15 UTC
Note that this also affects selectors (over both 0-10 and 1.0). It is a side-effect of the filtering logic added to queues (hence the skip-errata flag, since this will not have been released in product yet).

Comment 2 Gordon Sim 2013-08-16 22:16:00 UTC
Fixed upstream: https://svn.apache.org/r1514907

Comment 3 Petr Matousek 2013-09-06 15:40:59 UTC
This issue has been fixed. Verified on rhel6.4 (i386,x86_64).

packages used for testing:
qpid-cpp-*-0.22-13.el6


Note You need to log in before you can comment on or make changes to this bug.