[rabbitmq-discuss] Pika error - ack/reject throws exception

David Robins drobins at FreedomScientific.com
Thu Feb 9 15:13:51 GMT 2012


I'm using Pika and Python (3.2.2) to access RabbitMQ (2.6.1) queues, on Linux (kernel 3.0.6); specifically, I have some code that creates a blocking connection, binds a channel to a couple of queues, calls
basic_consume on the channel for each queue with no_ack=False, and then start_consuming.

It drains a (random - in recent runs I saw 14, 4, then 9) number of messages already in the queue under basic_consume, but then throws the following exception:

        Traceback (most recent call last):
                File "./ep_test", line 62, in <module>
                        et.track(args.drain)
                File "./ep_test", line 41, in track
                        self.q2.consume(callback, auto_ack=False)
                File "/home/dbrobins/code/utils/tq/broker.py", line 45, in consume
                        self.brk.chan.basic_consume(thunk, queue=self.qname, no_ack=auto_ack)
                File "/usr/lib64/python3.2/site-packages/pika-0.9.5-py3.2.egg/pika/channel.py", line 368, in basic_consume
                        [spec.Basic.ConsumeOk])
                File "/usr/lib64/python3.2/site-packages/pika-0.9.5-py3.2.egg/pika/adapters/blocking_connection.py", line 224, in rpc
                        frame = self._frames[reply]
        KeyError: 'Basic.ConsumeOk'

Am I doing something wrong in thinking I can ack a message in this state? It doesn't throw an exception with no_ack=True. If so, what? Or is it a bug in the pika module or a problem with RabbitMQ?

I've done a little debugging and it's possible I'm getting two Basic.ConsumeOk frames - if so, would that be a bug in RabbitMQ or does the client need to expect this? Is there a way to get verbose debug
output from RabbitMQ? - searches indicate no, except perhaps to watch it with an independent network tracing tool? Thanks for any help.

...

This is likely an instance of issue #70 on GitHub (https://github.com/pika/pika/issues/70) which says "Pending Fix" - does that mean that a fix is available but unreleased, or that there is no fix yet?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120209/6db8d0a2/attachment.htm>


More information about the rabbitmq-discuss mailing list