Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Description of problem:
python-qpid does not recover if its select() call within the Selector class has been interrupted. This is a problem when setuid() is called after a connection object has been created (hence a new thread has been created).
Version-Release number of selected component (if applicable):
python-qpid-0.14
python-qpid-0.12
How reproducible:
Always.
Steps to Reproduce:
1. Create a queue called justin
2. Run the following program:
#!/usr/bin/python
import os, sys, time
from qpid.messaging import Connection
from qpid.messaging import Message
addressdefault = 'localhost:5672'
if len(sys.argv) != 2:
host = addressdefault
else:
host = sys.argv[1]
def do_message():
conn = Connection(host)
conn.open()
sess = conn.session()
sender = sess.sender('justin')
message = Message(content='hello world!')
sender.send(message)
do_message()
try:
os.setuid(500)
except:
print "Exception has happened"
pass
do_message()
Actual results:
Traceback:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib64/python2.4/threading.py", line 442, in __bootstrap
self.run()
File "/usr/lib64/python2.4/threading.py", line 422, in run
self._target(*self.args, **self._kwargs)
File "/usr/lib/python2.4/site-packages/qpid/selector.py", line 119, in run
rd, wr, ex = select(self.reading, self.writing, (), timeout)
error: (4, 'Interrupted system call')
Expected results:
No traceback.