Red Hat Bugzilla – Bug 537481
qpid-stat needs option to link sesion to queue via subscription object
Last modified: 2015-11-15 20:11:57 EST
There is now a subscription object in QMF, which links the queue to the session. We need to add options to qpid-stat that. - show for session the list of subscriptions and the queue names connected to the subscription. - show for a queue, the subscripons, and for each subscription the session and connection including the process and pid. Carl.
I've committed a change at svn rev 917718 that displays subscription information, relating queues, sessions, and connections. The sorting functionality can be used to group the subscription info by queue (add "-S queue" to the command line) or by connection (add "-S connection").
Although the feature was implemented (the -u switch was added), there were uncovered following issues: - basic 'qpid-stat -u' - works if run one instance of the command at one time - the implementation is not thread safe as if there are two instances of 'qpid-stat -u' overlapping then first one will do the operation the second one will fail with: RHEL4 and also RHEL5 case: [root@mrg-qe-07 ~]# qpid-stat -u Failed: IndexError - list index out of range Traceback (most recent call last): File "/usr/bin/qpid-stat", line 528, in ? bm.display() File "/usr/bin/qpid-stat", line 466, in display self.displayMain(_types[0], _types[1:]) File "/usr/bin/qpid-stat", line 445, in displayMain elif main == 'u': self.displaySubscriptions(subs) File "/usr/bin/qpid-stat", line 418, in displaySubscriptions row.append(self.qmf.getObjects(_objectId=s.queueRef)[0].name) IndexError: list index out of range - the filtering feature of qpid-stat - works ok on RHEL5 - on RHEL4 gives: [root@mrg-qe-07 ~]# qpid-stat -u -S queue Failed: TypeError - sort() takes no keyword arguments Traceback (most recent call last): File "/usr/bin/qpid-stat", line 528, in ? bm.display() File "/usr/bin/qpid-stat", line 466, in display self.displayMain(_types[0], _types[1:]) File "/usr/bin/qpid-stat", line 445, in displayMain elif main == 'u': self.displaySubscriptions(subs) File "/usr/bin/qpid-stat", line 433, in displaySubscriptions sorter = Sorter(heads, rows, _sortcol, _limit, _increasing) File "/usr/lib/python2.3/site-packages/qpid/disp.py", line 224, in __init__ list.sort(reverse=not inc) TypeError: sort() takes no keyword arguments These are two separate issues with qpid-stat at the moment (coming from package qpid-tools-0.7.946106-10.el4/5). First one may be addressed as separate defect, but the second one should be solved within this defect record as the sorting was part of the solution mentioned by description and also comment 2. -> ASSIGNED
Both issues are fixed upstream in revision 999918.
An re-test update: The concurrent run issue was resolved by qpid-tools-0.7.946106-11, but the other sorting issue on RHEL4 which points to qpid/disp.py is still present as python-qpid was not rebuilt yet. At the moment I'm using: qpid-tools-0.7.946106-11.el4/5 python-qpid-0.7.946106-14.el4/5
The above mentioned RHEL4 sorting issue is now addressed separately as bug 637127. The sorting option is actually fully orthogonal to the list of subscriptions as the sorting was implemented in 1.2 version already and subscription list was added post 1.2. The feature was implemented and is functional, tested on RHEL 4.8 / 5.5 i386 / x86_64 on packages: qpid-tools-0.7.946106-11.el4/5 python-qpid-0.7.946106-14.el4/5 -> VERIFIED
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Previously, 'qpid-stat' did not contain options for a subscription object (links a queue to a session) in QMF. With this update, the following options are introduced: - for a specific session, displays the list of subscriptions and the queue names connected to the subscription. - for a specific queue, displays the subscriptions, and for each subscription the session and connection including the process and its pid.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2010-0773.html