Bug 772028 - malfunctioning unsettled() receiver method
Summary: malfunctioning unsettled() receiver method
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: python-qpid
Version: Development
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 3.0
: ---
Assignee: Ernie
QA Contact: Chuck Rolke
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-05 17:14 UTC by Petr Matousek
Modified: 2014-09-24 15:03 UTC (History)
4 users (show)

Fixed In Version: python-qpid-0.22-3.el6, python-qpid-0.22-2.el5
Doc Type: Bug Fix
Doc Text:
It was discovered that the python messaging method `receiver.unsettled()` referenced a non-existent "acked" variable. Calling `receiver.unsettled()` raised an exception. The fix now uses `session.acked` instead of `receiver.acked`, which ensures the correct number of unsettled messages are returned.
Clone Of:
Environment:
Last Closed: 2014-09-24 15:03:46 UTC
Target Upstream Version:


Attachments (Terms of Use)
Uses session.acked list to determine the number of acknowledged messages awaiting confirmation (511 bytes, patch)
2013-03-22 13:58 UTC, Ernie
no flags Details | Diff
Adds a testUnsettled to the receiver tests (674 bytes, patch)
2013-04-19 16:31 UTC, Ernie
no flags Details | Diff
shell reproducer (6.38 KB, application/x-gzip)
2013-07-10 19:46 UTC, Chuck Rolke
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-4140 0 None None None Never
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

Description Petr Matousek 2012-01-05 17:14:49 UTC
Description of problem:

following error is displayed when the method is called:

Traceback (most recent call last):
  File "./default_capacity.py", line 9, in ?
    receiver.unsettled()
  File "<string>", line 6, in unsettled
  File "/usr/lib/python2.4/site-packages/qpid/messaging/endpoints.py", line 974, in unsettled
    return len([m for m in self.acked if m._receiver is self])
AttributeError: 'Receiver' object has no attribute 'acked'

Version-Release number of selected component (if applicable):
python-qpid-0.14-1.el5

How reproducible:
100%

Steps to Reproduce:
simple reproducer:

from qpid.messaging import *

connection = Connection("localhost:5672")
connection.open()
session = connection.session()
receiver = session.receiver("q;{create:receiver,delete:receiver}")
print receiver.unsettled()
connection.close()
  
Actual results:
An error occurs by calling receiver unsettled() method

Expected results:
No error occurs, a count of the number of messages received on this receiver that have been acknowledged, but for which that acknowledgement has not yet been confirmed as processed by the server is returned by this method. 

Additional info:

Comment 1 Ernie 2013-03-22 13:58:39 UTC
Created attachment 714553 [details]
Uses session.acked list to determine the number of acknowledged messages awaiting confirmation

It appears the intent was to count the number of acked messages in the session's acked list (that are 'owned' by the receiver).

Comment 2 Justin Ross 2013-04-18 14:09:48 UTC
Ernie, I can't pull this one in until it has a test.

Comment 3 Ernie 2013-04-19 16:31:14 UTC
Created attachment 737696 [details]
Adds a testUnsettled to the receiver tests

This just tests the code path and not the validity of the return value.

Comment 4 Justin Ross 2013-04-23 21:30:35 UTC
-> POST

http://svn.apache.org/viewvc?view=revision&revision=1471150

Comment 5 Chuck Rolke 2013-07-10 19:46:41 UTC
Created attachment 771817 [details]
shell reproducer

shell reproducer (cloned from bz964189) using several QA hooks for determining success/failure. This could be used for automated or manual tests.

1. Starts a fresh broker
2. Emits a python script
3. Executes python script and extracts exit status from it
4. Exits with standard error format

Comment 6 Chuck Rolke 2013-07-11 19:56:07 UTC
This bug also has a reproducer built-in to the normal system tests and does not need QA special treatment.
This bug is verified manually on the systems listed below.

System:
2.6.32-358.el6.x86_64
Packages: -----------------------------[begin]
python-qpid-0.22-4.el6.noarch
python-qpid-qmf-0.22-5.el6.x86_64
qpid-cpp-client-0.22-6.el6.x86_64
qpid-cpp-client-devel-0.22-6.el6.x86_64
qpid-cpp-server-0.22-6.el6.x86_64
qpid-proton-c-0.4-2.2.el6.x86_64
qpid-proton-c-devel-0.4-2.2.el6.x86_64
qpid-qmf-0.22-5.el6.x86_64
qpid-tools-0.22-3.el6.noarch
Packages: -------------------------------[end]

System:
2.6.32-358.el6.i686
Packages: -----------------------------[begin]
python-qpid-0.22-4.el6.noarch
python-qpid-qmf-0.22-5.el6.i686
qpid-cpp-client-0.22-6.el6.i686
qpid-cpp-client-devel-0.22-6.el6.i686
qpid-cpp-server-0.22-6.el6.i686
qpid-proton-c-0.4-2.2.el6.i686
qpid-proton-c-devel-0.4-2.2.el6.i686
qpid-qmf-0.22-5.el6.i686
qpid-tools-0.22-3.el6.noarch
Packages: -------------------------------[end]

System:
2.6.18-348.el5PAE
Packages: -----------------------------[begin]
python-qpid-0.22-4.el5
python-qpid-qmf-0.22-5.el5
qpid-cpp-client-0.22-6.el5
qpid-cpp-client-devel-0.22-6.el5
qpid-cpp-server-0.22-6.el5
qpid-proton-c-0.4-2.2.el5
qpid-proton-c-devel-0.4-2.2.el5
qpid-qmf-0.22-5.el5
qpid-tools-0.22-2.el5
Packages: -------------------------------[end]

System:
2.6.18-348.6.1.el5
Packages: -----------------------------[begin]
python-qpid-0.22-4.el5
python-qpid-qmf-0.22-5.el5
qpid-cpp-client-0.22-6.el5
qpid-cpp-client-devel-0.22-6.el5
qpid-cpp-server-0.22-6.el5
qpid-java-client-0.22-2.el5
qpid-java-common-0.22-2.el5
qpid-java-example-0.22-2.el5
qpid-proton-c-0.4-2.2.el5
qpid-proton-c-devel-0.4-2.2.el5
qpid-qmf-0.22-5.el5
qpid-tools-0.22-2.el5
Packages: -------------------------------[end]

Comment 9 errata-xmlrpc 2014-09-24 15:03:46 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.