Bug 893980

Summary: Timeout waiting for sync on declaring queue/topic with the same identifier
Product: Red Hat Enterprise MRG Reporter: Petr Matousek <pematous>
Component: qpid-javaAssignee: Rajith Attapattu <rattapat+nobody>
Status: CLOSED ERRATA QA Contact: Petr Matousek <pematous>
Severity: medium Docs Contact:
Priority: medium    
Version: DevelopmentCC: esammons, iboverma, jross, mcressma
Target Milestone: 2.3Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qpid-java-0.18-7 Doc Type: Bug Fix
Doc Text:
Cause: The underlying root cause was due to the producer trying to delete a non existent subscription queue. This causes a session error, which doesn't get picked up by the client while it's waiting for completion. Eventually the wait timesout. Consequence: The client appears to hang and then timesout. Fix: The producers does not attempt to delete the subscription queue. However the underlying issue with regards to error handling is still there. Result: The client does not timeout anymore.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-06 18:53:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
qpid-java-*-0.18-6, qpid-cpp-*-0.18-13 transcript
none
qpid-java-*-0.18-2.el5, qpid-cpp-*-0.14-22.el5 transcript none

Description Petr Matousek 2013-01-10 12:51:25 UTC
Description of problem:

Declare a queue and after that declare an exchange with the same identifier.
However both queue and exchange is created, following exception is thrown: 

AMQException: timed out waiting for sync: not-found: Delete failed. No such queue

Declaring the ambiguous address in the opposite order (an exchange first, then a queue) seems to be working fine. But the exception occurs by sending a message to that exchange as well.

Summarizing: The ambiguous address can be created (queue and exchange with the same name), messages seems to be delivered properly to both queue and exchange, but timeout exception shall not appear.

This worked fine on latest release (qpid-java-*-0.18-2.el5, qpid-cpp-*-0.14-22.el5), so marking this issue as regression.

Please see additional info for more information.

Version-Release number of selected component (if applicable):
qpid-java-*-0.18-6
qpid-cpp-*-0.18-13

How reproducible:
100%

Steps to Reproduce:
1. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "q_ex;{ create:sender, node: { type:queue }}"
2. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "q_ex;{ create:sender, node: { type:topic }}"
3. exception
  
Actual results:
Several exceptions on ambiguous address creation / message delivery.

Expected results:
No exceptions on ambiguous address creation / message delivery.
Set of commands in additional info do not produce unexpected exceptions.

Additional info:

Assume following set of commands:

1. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "ex_q;{ create:sender, node: { type:topic }}"
2. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "ex_q;{ create:sender, node: { type:queue }}"
3. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "ex_q"
4. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "ex_q;{node:{type:topic}}"
5. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "ex_q;{node:{type:queue}}"


6. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "q_ex;{ create:sender, node: { type:queue }}"
7. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "q_ex;{ create:sender, node: { type:topic }}"
8. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "q_ex"
9. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "q_ex;{node:{type:queue}}"
10. java -cp ${CLASSPATH} org.apache.qpid.example.Spout "q_ex;{node:{type:topic}}"

All the addresses are created (queue and exchange named 'ex_q', queue and exchange named 'q_ex'), messages are delivered correctly (2 messages to each address). 

But exceptions are raised in step 4, 7, 10, these exceptions shall not appear. An exception is also raised in step 3. and 8. which is correct (user has to specify ambiguous address type).

Please see the attached transcripts for more details.

Comment 1 Petr Matousek 2013-01-10 12:55:45 UTC
Created attachment 676298 [details]
qpid-java-*-0.18-6, qpid-cpp-*-0.18-13 transcript

Comment 2 Petr Matousek 2013-01-10 12:56:35 UTC
Created attachment 676299 [details]
qpid-java-*-0.18-2.el5, qpid-cpp-*-0.14-22.el5 transcript

Comment 4 Justin Ross 2013-01-10 15:46:00 UTC
Rajith, please assess.

Comment 5 Rajith Attapattu 2013-01-17 01:15:32 UTC
I have made a fix upstream at http://svn.apache.org/viewvc?rev=1434492&view=rev
The issue is tracked via QPID-4540

The underlying root cause was due to the producer trying to delete a non existing subscription queue. The delicate situation in the error handling compounded the problem by manifesting it as a timeout.

I have tested all the cases as outlined in the BZ as verification in addition to enhancing an existing system test to verify the root cause.

Comment 8 Petr Matousek 2013-01-24 15:38:31 UTC
This issue has been fixed.

Verified on rhel5.9 and rhel6.4 Beta (x86_64, i386)

packages used for testing:
qpid-java-*-0.18-7

-> VERIFIED

Comment 11 errata-xmlrpc 2013-03-06 18:53:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0561.html