[rabbitmq-discuss] Pika 0.9.5 - How to handle Rabbit Stop ?
Tim Watson
tim at rabbitmq.com
Fri Aug 31 17:15:56 BST 2012
Hi David,
What *kind* of adapter is this connection please? I know very little about Pika, but I can attempt to figure out what you *should* be doing to get the behaviour you want. But there's a big difference between the behaviours of say, the blocking versus the polling/select based adapters.
Cheers,
Tim
On 29 Aug 2012, at 10:42, David Myllykangas wrote:
>
> Hi
>
> We are using Rabbit 2.8.5 and Pika 0.9.5 to process rabbit-queue from python.
>
> If I am doing a 'rabbitctrl stop' to stop Rabbit Server, my python script hangs, and get uninteruptable.
>
> This is the console output I get when I stop the Rabbit Server
>
> Traceback (most recent call last):
> File ".../pycims/queue.py", line 87, in start_consuming
> connection.ioloop.start()
> File ".../pika/adapters/select_connection.py", line 124, in start
> self.poller.start()
> File ".../pika/adapters/select_connection.py", line 374, in start
> self.poll()
> File ".../pika/adapters/select_connection.py", line 388, in poll
> self._handler(events[0][0], events[0][1])
> File ".../pika/adapters/base_connection.py", line 137, in _handle_events
> self._handle_error(error)
> File ".../pika/adapters/base_connection.py", line 106, in _handle_error
> error_code = error[0] # Python <= 2.5
> TypeError: 'NoneType' object is not subscriptable
>
> This is the code; (I am expecting an Exception to be thrown on line 93, so I can handle the situation.) What am I doing wrong?
>
> 86 try:
> 87 connection.ioloop.start()
> 88 except KeyboardInterrupt:
> 89 self.stop_consuming()
> 90 connection.ioloop.stop()
> 91 connection.close()
> 92 raise
> 93 except Exception, e:
> 94 print 'Exception %s' % str(e)
> 95 raise
>
> Thanks,
> David
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120831/0ab34914/attachment.htm>
More information about the rabbitmq-discuss
mailing list