How do you shutdown the tutorial client without raising an exception?

Asked by Jonathan Stoppani

Hi,
when trying to close the connection to the AMQP server as showed in the tutorial (adding a lambda callback with "reactor.stop()"), the following exception is thrown:

Unhandled error in Deferred:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/txAMQP-0.2-py2.6.egg/txamqp/queue.py", line 48, in close
    self.put(TimeoutDeferredQueue.END)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.3-fat.egg/twisted/internet/defer.py", line 992, in put
    self.waiting.pop(0).callback(obj)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.3-fat.egg/twisted/internet/defer.py", line 243, in callback
    self._startRunCallbacks(result)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.3-fat.egg/twisted/internet/defer.py", line 312, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.3-fat.egg/twisted/internet/defer.py", line 328, in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/txAMQP-0.2-py2.6.egg/txamqp/queue.py", line 32, in _raiseIfClosed
    raise Closed()
txamqp.queue.Closed:

Looking at the source code it seems that someone is listening on incoming messages using a TimeoutDeferredQueue but is not catching Closed exceptions. Is it possible? Am I wrong somewhere?

Question information

Language:
English Edit question
Status:
Answered
For:
txAMQP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Esteve Fernandez (esteve) said :
#1

There's a bug in AMQClient#connectionLost which makes TimeoutDeferredQueue to raise an exception if the queue is closed. In the meantime until that bug is fixed, just comment out connectionLost.

Thanks!

Can you help with this problem?

Provide an answer of your own, or ask Jonathan Stoppani for more information if necessary.

To post a message you must log in.