Bug 613912 - qpid python client [high level API] crash 'NameError: global name 'URL' is not defined' in qpid/messaging/driver.py
qpid python client [high level API] crash 'NameError: global name 'URL' is no...
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: python-qpid (Show other bugs)
Development
All Linux
high Severity high
: 1.3
: ---
Assigned To: Rafael H. Schloming
Frantisek Reznicek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-13 04:23 EDT by Frantisek Reznicek
Modified: 2015-11-15 20:12 EST (History)
3 users (show)

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


Attachments (Terms of Use)
The issue reproducer and logs (81.22 KB, application/x-tbz)
2010-07-13 04:28 EDT, Frantisek Reznicek
no flags Details

  None (edit)
Description Frantisek Reznicek 2010-07-13 04:23:27 EDT
Description of problem:

High level python client library crashes with:
  NameError: global name 'URL' is not defined in qpid/messaging/driver.py", line 338 (rhel4.8 case)

in case Connection's reconnect_urls property is set.


For instance:
cat X | ../spout.py --address=RzhAYeaLB3p; {create: sender, delete: receiver}
" --reconnect --reconnect-interval=1 --reconnect-limit=10 --reconnect-urls=mrg-
qe-01.lab.eng.brq.redhat.com:5672,mrg-qe-02.lab.eng.brq.redhat.com:5672

which sets appropriate values in Connection constructor:
  conn_opts = { };
  if len(opts.reconnect_urls)>0:
    conn_opts['reconnect_urls'] = opts.reconnect_urls.split(',');
    print >> sys.stderr, "DEBUG: %s" % conn_opts;
  
  conn = Connection(opts.broker,
                    reconnect=opts.reconnect,
                    reconnect_interval=opts.reconnect_interval,
                    reconnect_limit=opts.reconnect_limit,
                    **conn_opts)

conn_urls are set this way:
  DEBUG: {'reconnect_urls': ['mrg-qe-01.lab.eng.brq.redhat.com:5672', 'mrg-qe-02.lab.eng.brq.redhat.com:5672']}

which I believe is correct.

The issue was seen on both python-qpid-0.7.946106-4 and python-qpid-0.7.946106-6


Version-Release number of selected component (if applicable):
python-qpid-0.7.946106-4, python-qpid-0.7.946106-6

How reproducible:
100%

Steps to Reproduce:
0. start the broker (--auth no)
1. run attached client:
  cat X | \
    ../spout.py --address="RzhAYeaLB3p; {create: sender, delete:receiver}" \
    --reconnect --reconnect-interval=1 --reconnect-limit=10 \
    --reconnect-urls=<host>:5672
2. client crashes as described above
  
Actual results:
qpid python client based on high level api crashes in qpid/messaging/driver.py.

Expected results:
qpid python client should not crash.

Additional info:

.config (i_cluster_config:01, i/j:0/3, addr:QtbJXpm770KReOk4u6owXwD5rUyuEPC3uXiHT7Q, cli_params:--reconnect --reconnect-interval=1 --reconnect-li
mit=10 --reconnect-urls=mrg-qe-01.lab.eng.brq.redhat.com:5672, tx/rx_status:10) [err_cnt:0]
.send data (host:mrg-qe-01.lab.eng.brq.redhat.com, addr:QtbJXpm770KReOk4u6owXwD5rUyuEPC3uXiHT7Q)
DEBUG: {'reconnect_urls': ['mrg-qe-01.lab.eng.brq.redhat.com:5672']}
Traceback (most recent call last):
  File "../spout.py", line 127, in <module>
    **conn_opts)
  File "/usr/lib/python2.5/site-packages/qpid/messaging/endpoints.py", line 166, in __init__
    self._driver = Driver(self)
  File "/usr/lib/python2.5/site-packages/qpid/messaging/driver.py", line 325, in __init__
    urls = [URL(u) for u in self.connection.reconnect_urls]
NameError: global name 'URL' is not defined
..ecode:1
.receive data  (host:mrg-qe-02.lab.eng.brq.redhat.com, addr:QtbJXpm770KReOk4u6owXwD5rUyuEPC3uXiHT7Q)
DEBUG: {'reconnect_urls': ['mrg-qe-01.lab.eng.brq.redhat.com:5672']}
Traceback (most recent call last):
  File "../drain.py", line 100, in <module>
    **conn_opts)
  File "/usr/lib/python2.5/site-packages/qpid/messaging/endpoints.py", line 166, in __init__
    self._driver = Driver(self)
  File "/usr/lib/python2.5/site-packages/qpid/messaging/driver.py", line 325, in __init__
    urls = [URL(u) for u in self.connection.reconnect_urls]
NameError: global name 'URL' is not defined
..ecode:1
Comment 1 Frantisek Reznicek 2010-07-13 04:28:07 EDT
Created attachment 431385 [details]
The issue reproducer and logs

How to run?
1] 'make rb' to compile c++ high level clients
2] cd test/
3] ./test_reconnect.sh

You should see ./test_reconnect.sh.log created and search there for the above listed issue. (There are packaged my runs)
Comment 3 Frantisek Reznicek 2010-07-29 08:48:40 EDT
The issue has been fixed, tested on RHEL 4.8 / 5.5 / 6.0beta i386 / x86_64 on packages:
python-qpid-0.7.946106-9.el4/5/6
qpid-cpp-server-0.7.946106-10.el4/5
qpid-cpp-server-0.7.946106-5.el6.i686

-> VERIFIED

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