Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 912519 - broker ignores if_empty and if_unused flags when deleting queues
broker ignores if_empty and if_unused flags when deleting queues
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp (Show other bugs)
2.3
Unspecified Unspecified
high Severity high
: 3.0
: ---
Assigned To: Ernie
Leonid Zhaldybin
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-18 16:11 EST by Ernie
Modified: 2014-11-09 17:39 EST (History)
6 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-24 11:06:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Apache JIRA QPID-4559 None None None Never
Red Hat Product Errata RHEA-2014:1296 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.0 Release 2014-09-24 15:00:06 EDT

  None (edit)
Description Ernie 2013-02-18 16:11:27 EST
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 11:39:15 EST
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 13:55:19 EST
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 09:47:19 EST
Created attachment 702380 [details]
Add checkDeleteQueue method to broker

Patch reviewed
Comment 4 Ted Ross 2013-03-13 15:01:33 EDT
Fix committed upstream at revision 1456081.
Comment 5 Leonid Zhaldybin 2013-08-13 05:29:28 EDT
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 11:06:23 EDT
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.