Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 537481

Summary: qpid-stat needs option to link sesion to queue via subscription object
Product: Red Hat Enterprise MRG Reporter: Carl Trieloff <cctrieloff>
Component: qpid-qmfAssignee: Nuno Santos <nsantos>
Status: CLOSED ERRATA QA Contact: Frantisek Reznicek <freznice>
Severity: medium Docs Contact:
Priority: high    
Version: 1.1.6CC: aortega, esammons, freznice, iboverma, tross
Target Milestone: 1.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-14 16:09:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Carl Trieloff 2009-11-13 19:36:50 UTC
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.

Comment 2 Nuno Santos 2010-03-01 21:06:37 UTC
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").

Comment 4 Frantisek Reznicek 2010-09-22 11:17:31 UTC
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

Comment 5 Ted Ross 2010-09-22 12:51:37 UTC
Both issues are fixed upstream in revision 999918.

Comment 6 Frantisek Reznicek 2010-09-23 08:50:14 UTC
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

Comment 8 Frantisek Reznicek 2010-09-24 12:09:35 UTC
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

Comment 9 Martin Prpič 2010-10-07 13:59:07 UTC
    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.

Comment 11 errata-xmlrpc 2010-10-14 16:09:35 UTC
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