Bug 912519 - broker ignores if_empty and if_unused flags when deleting queues
Summary: broker ignores if_empty and if_unused flags when deleting queues
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 2.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 3.0
: ---
Assignee: Ernie
QA Contact: Leonid Zhaldybin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-18 21:11 UTC by Ernie
Modified: 2014-11-09 22:39 UTC (History)
6 users (show)

Fixed In Version: qpid-cpp-0.22
Doc Type: Bug Fix
Doc Text:
It was discovered that the C++ broker ignored the `if_empty` and `if_unused` flags when a queue was deleted. If the queue was in use or non-empty, and a call was made to delete the queue only if it was unused or empty, the queue would incorrectly be deleted anyway. The fix inspects the `if_empty` and `if_unused` flags, and will not delete the queue if it is in use or non-empty when appropriate. Queues are no longer incorrectly deleted when the `if_empty` or `if_unused` flags are used.
Clone Of:
Environment:
Last Closed: 2014-09-24 15:06:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Add checkDeleteQueue method to broker (2.84 KB, patch)
2013-02-25 14:47 UTC, Ernie
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-4559 0 None None None Never
Red Hat Bugzilla 903126 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Product Errata RHEA-2014:1296 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.0 Release 2014-09-24 19:00:06 UTC

Internal Links: 903126

Description Ernie 2013-02-18 21:11:27 UTC
Description of problem:
When the if_empty=true and if_unused=true flags are passed to the deleteObject method on the c++ broker, the queue is deleted even if it is not empty or in use.

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. qpid-config add queue q
2. spout -c 1 q
3. qpid-config del queue q
  
Actual results:
The queue is deleted.

Expected results:
Failed: Exception: Exception from Agent: {u'error_code': 7, u'error_text': 'precondition-failed: Cannot delete queue q; queue not empty (qpid/broker/Broker.cpp:911)'}


Additional info:
The latest release has a workaround implemented in qpid-config. This fix should remove that workaround and fix the C++ broker instead.

Comment 1 Petr Matousek 2013-02-19 16:39:15 UTC
I suppose that fix for this issue won't affect the addressing behaviour, ie:
Following command will still create the queue q, send ten messages on that queue and finally remove the (non-empty) queue. Are my assumptions correct?

# ./spout -c 10 "q;{create:sender. delete:sender}"

Comment 2 Ernie 2013-02-19 18:55:19 UTC
That is correct. 
./spout -c 10 "q;{create:sender, delete:sender}" will not generate an exception and the queue will be deleted.

The exception can only be raised when the if_empty or if_unused flags are used.

Comment 3 Ernie 2013-02-25 14:47:19 UTC
Created attachment 702380 [details]
Add checkDeleteQueue method to broker

Patch reviewed

Comment 4 Ted Ross 2013-03-13 19:01:33 UTC
Fix committed upstream at revision 1456081.

Comment 5 Leonid Zhaldybin 2013-08-13 09:29:28 UTC
Tested on RHEL6.4 (both i386 and x86_64). This issue has been fixed.

Packages used for testing:

python-qpid-0.22-4.el6
python-qpid-qmf-0.22-8.el6
qpid-cpp-client-0.22-10.el6
qpid-cpp-client-devel-0.22-10.el6
qpid-cpp-client-devel-docs-0.22-10.el6
qpid-cpp-client-ssl-0.22-10.el6
qpid-cpp-server-0.22-10.el6
qpid-cpp-server-devel-0.22-10.el6
qpid-cpp-server-ssl-0.22-10.el6
qpid-cpp-server-store-0.22-10.el6
qpid-cpp-server-xml-0.22-10.el6
qpid-java-client-0.22-5.el6
qpid-java-common-0.22-5.el6
qpid-java-example-0.22-5.el6
qpid-jca-0.18-8.el6
qpid-jca-xarecovery-0.18-8.el6
qpid-proton-c-0.4-2.2.el6
qpid-qmf-0.22-8.el6
qpid-snmpd-1.0.0-12.el6
qpid-tools-0.22-3.el6
rh-qpid-cpp-tests-0.22-10.el6

-> VERIFIED

Comment 6 errata-xmlrpc 2014-09-24 15:06:23 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/RHEA-2014-1296.html


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