Bug 589908 - QMF python console: list index out of range FAILURE
QMF python console: list index out of range FAILURE
Status: CLOSED NOTABUG
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-qmf (Show other bugs)
Development
All Linux
urgent Severity urgent
: 1.3
: ---
Assigned To: Ted Ross
Jan Sarenik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-07 05:21 EDT by Jan Sarenik
Modified: 2011-08-12 12:02 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-05 04:53:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
C++ QMF agent with Python test (3.84 KB, application/x-gzip)
2010-05-07 05:21 EDT, Jan Sarenik
no flags Details
C++ QMF agent with Python test in a loop (3.86 KB, application/x-gzip)
2010-07-08 03:53 EDT, Jan Sarenik
no flags Details
C++ QMF agent with a fixed Python test in a loop (3.88 KB, application/x-gzip)
2010-07-08 04:47 EDT, Jan Sarenik
no flags Details

  None (edit)
Description Jan Sarenik 2010-05-07 05:21:41 EDT
Created attachment 412274 [details]
C++ QMF agent with Python test

While testing bug 547519, I found this strange behavior:

Traceback (most recent call last):
  File "<stdin>", line 5, in ?
IndexError: list index out of range
FAILURE

Version-Release number of selected component (if applicable):
  python-qpid-0.7.938298-1.el5
  qpid-cpp-server-0.7.939184-1.el5

Very easily reproducible:
1. run qpidd
2. run 'while perftest; do :; done' in one terminal (this is not vital)
3. run 'while ./runtest.sh; do :; done' in qmf-agent-20100507 directory
   in another terminal
  
Actual results:
  IndexError: list index out of range

Expected results (it appears, but it should appear ALWAYS):
  {u'second': 34, u'map-data': {u'numeric-data': 10000, u'string-data': 'Text'}, u'first': 'String data'}
Comment 1 Jan Sarenik 2010-06-25 04:58:17 EDT
On python-qpid-0.7.946106-2.el5 I am getting this error on _every_
run instead of occasionally. Raising priority.
Comment 2 Jan Sarenik 2010-06-25 04:58:51 EDT
See TCMS https://tcms.engineering.redhat.com/case/47650/?from_plan=2216
Comment 3 Jan Sarenik 2010-06-25 08:46:21 EDT
Strangely enough, on RHEL6, python-qmf-0.7.946106-4.el6.noarch
it ends with same error only ocassionally.
Comment 4 Jan Sarenik 2010-07-08 03:04:42 EDT
I am retesting this with python-qpid-0.7.946106-4.el5 now and everything
seems to be working, running in a loop of one thousand runs, will get
back with results soon.
Comment 5 Jan Sarenik 2010-07-08 03:52:32 EDT
So the problem is that 17 out of 1000 runs ended with following:

--------------------------------------------------------------------------
{u'second': 34, u'map-data': {u'numeric-data': 10000, u'string-data': 'Text'}, u'first': 'String data'}
Exception in thread Thread for broker: localhost:5672 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib64/python2.4/threading.py", line 442, in __bootstrap
  File "/usr/lib/python2.4/site-packages/qmf/console.py", line 2539, in run
  File "/usr/lib64/python2.4/Queue.py", line 125, in get
exceptions.TypeError: 'NoneType' object is not callable
Unhandled exception in thread started by 
Error in sys.excepthook:

Original exception was:
--------------------------------------------------------------------------

The rest ended merely with the first line,
{u'second': 34, u'map-data': {u'numeric-data': 10000, u'string-data': 'Text'}, u'first': 'String data'}

Everything was performed on RHN-up-to-date RHEL5 x86_64 with
qpid-cpp-server-0.7.946106-6.el5 running with --auth=no.
python-qpid-0.7.946106-4.el5
Comment 6 Jan Sarenik 2010-07-08 03:53:46 EDT
Created attachment 430267 [details]
C++ QMF agent with Python test in a loop

This is the reproducer I used.
Comment 7 Gordon Sim 2010-07-08 04:00:55 EDT
I believe you can avoid that by calling s.delBroker(b) at the end of the python script.
Comment 8 Jan Sarenik 2010-07-08 04:05:35 EDT
Thank you, Gordon. This way the only remaining problem is cleared out
and I will now focus on verifying this bug on all the supported systems.
Comment 9 Jan Sarenik 2010-07-08 04:47:27 EDT
Created attachment 430270 [details]
C++ QMF agent with a fixed Python test in a loop

Verified on RHEL5 x86_64
  qpid-cpp-server-0.7.946106-6.el5
  python-qpid-0.7.946106-4.el5
  python-qmf-0.7.946106-5.el5
Comment 10 Jan Sarenik 2010-07-08 05:26:42 EDT
Oh no, sorry, it is not working on i386.
------------------------------------------
Traceback (most recent call last):
  File "<stdin>", line 5, in ?
IndexError: list index out of range
------------------------------------------

RHEL5.5 i386
qmf-devel-0.7.946106-6.el5
python-qmf-0.7.946106-5.el5
python-qpid-0.7.946106-4.el5
qpid-cpp-server-0.7.946106-6.el5

Putting back to ASSIGNED.
Comment 11 Jan Sarenik 2010-08-05 04:47:55 EDT
Excuse me, this is rather error on the side of program I use.
It should first check if the list contains the element it
wants to read. Is this assumption right?

-------------------------------------------
from qmf.console import Session
s = Session()
b = s.addBroker()
parents = s.getObjects(_class="parent")
# check should go here
print parents[0].args
s.delBroker(b)
-------------------------------------------

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